Ranter
Join devRant
Do all the things like
++ or -- rants, post your own rants, comment on others' rants and build your customized dev avatar
Sign Up
Pipeless API
From the creators of devRant, Pipeless lets you power real-time personalized recommendations and activity feeds using a simple API
Learn More
Comments
-
JS96184598yWait a minute... volume 3???
The two previous books were selling well enough to convince them to go on? -
[r,g,b] = '🍎🍏🐳'
const apple = {r,g}
const find = (my, it) => it in apple? 'eat '+apple[it] : my
alert([...'rgb'].reduce(find,'')) -
@thejohnhoffer this will alert "eat 🍏” or "eat 🍎" based on whether the last letter in the test string is 'g' or 'r'. Yes, I've tested it in Chrome.
-
const find can't have line breaks, but I'd write it like this for "babies".
[r,g,b] = '🍎🍏🐳'
const apple = {r,g}
const find = (my, it) =>
it in apple? 'eat '+apple[it] : my
alert([...'rgb'].reduce(find,'')) -
@Aaronmacaron come on, you expect babies to look at the console :P
At least I hope they suggest to run that code on the browser rather than node.js ;)
JS.... you know... For the kids..
undefined