Post History
JavaScript (Node.js), 228 224 bytes -4 bytes thanks to Hakerh400 (b=n=>`${n} bottle${n-1?'s':''} of beer`,w=' on the wall')=>[...Array(99)].map((_,i)=>`${b(i=99-i)}${w}, ${b(i)}. `+(--i...
Answer
#2: Post edited
# [JavaScript (Node.js)], 228 bytes- ```javascript
(b=n=>`${n} bottle${n-1?'s':''} of beer`,w=' on the wall')=>Array(99).fill().map((_,i)=>`${b(i=99-i)}${w}, ${b(i)}.`+(--i?`Take one down and pass it around, `:(i=99,`Go to the store and buy some more, `))+b(i)+w+'.').join(``)- ```
- [Try it online!][TIO-krzm1vcx]
- [JavaScript (Node.js)]: https://nodejs.org
[TIO-krzm1vcx]: https://tio.run/##HY3BisMgFEX3@Yq3KOgjUZhlCrbMan6g@6qNmbE1vqB2pJR8eyaT3eVwOPdufk2@JT8XEWlw66hWblVUJ314xwUslRLcNsXHmWV2ZGwBGsE6l3RXFQOKUH4cVBMCQ3X6TMm8eN@jHH0IHOVkZs6vnce9aLlXfS88Lod3XTrYCS6y0S0Xwp/1xTzc1nQwUI1g4gCzyRl8AZPoGYcO9HFvdPqLoNB@ngslt8v2@YJMk4NpI5uL2P4ftLVlkqG8k49cN43G9UYxU3Ay0DcfOeL6Bw "JavaScript (Node.js) – Try It Online"
- # [JavaScript (Node.js)], ~~228~~ 224 bytes
- -4 bytes thanks to Hakerh400
- ```javascript
- (b=n=>`${n} bottle${n-1?'s':''} of beer`,w=' on the wall')=>[...Array(99)].map((_,i)=>`${b(i=99-i)}${w}, ${b(i)}.
- `+(--i?`Take one down and pass it around, `:(i=99,`Go to the store and buy some more, `))+b(i)+w+'.').join`
- `
- ```
- [Try it online!][TIO-krzm1vcx]
- [JavaScript (Node.js)]: https://nodejs.org
- [TIO-krzm1vcx]: https://tio.run/##HY3BasQgFEX3@Yq3GFCJCl1mwBm66g90V0o1E9M6Y3xBncow@O1p6u5yOJx7Nb8mXaJbswg42W1WGx1VUCd9eIYKI@bs7T7Fy5kkciSkAs4wWhs1L4oABsg/ForxnjB1@pBSvsZoHnQY2KdczErpF3es9Ubq1DAIx@rhWSqHRliVne6pEO6s383N7kULE5YAJkywmpTAZTAR72HioI@twfUbQsZ2nTJG2@Tx/oCEi4VlJ7vLWP9/0JeeSMLkFV3QXae3C4aE3kqP33SmjG1 "JavaScript (Node.js) – Try It Online"
#1: Initial revision
# [JavaScript (Node.js)], 228 bytes ```javascript (b=n=>`${n} bottle${n-1?'s':''} of beer`,w=' on the wall')=>Array(99).fill().map((_,i)=>`${b(i=99-i)}${w}, ${b(i)}. `+(--i?`Take one down and pass it around, `:(i=99,`Go to the store and buy some more, `))+b(i)+w+'.').join(` `) ``` [Try it online!][TIO-krzm1vcx] [JavaScript (Node.js)]: https://nodejs.org [TIO-krzm1vcx]: https://tio.run/##HY3BisMgFEX3@Yq3KOgjUZhlCrbMan6g@6qNmbE1vqB2pJR8eyaT3eVwOPdufk2@JT8XEWlw66hWblVUJ314xwUslRLcNsXHmWV2ZGwBGsE6l3RXFQOKUH4cVBMCQ3X6TMm8eN@jHH0IHOVkZs6vnce9aLlXfS88Lod3XTrYCS6y0S0Xwp/1xTzc1nQwUI1g4gCzyRl8AZPoGYcO9HFvdPqLoNB@ngslt8v2@YJMk4NpI5uL2P4ftLVlkqG8k49cN43G9UYxU3Ay0DcfOeL6Bw "JavaScript (Node.js) – Try It Online"