Cipherd@lemmy.ml to Programmer Humor@lemmy.ml · 25 days agofunctionslemmy.mlexternal-linkmessage-square35fedilinkarrow-up1282arrow-down14
arrow-up1278arrow-down1external-linkfunctionslemmy.mlCipherd@lemmy.ml to Programmer Humor@lemmy.ml · 25 days agomessage-square35fedilink
minus-squaredavel [he/him]@lemmy.mllinkfedilinkEnglisharrow-up13arrow-down1·25 days agoJavaScript can do better than that: () => {}
minus-squaredavel [he/him]@lemmy.mllinkfedilinkEnglisharrow-up4·edit-225 days agoHuh, I haven’t looked at C++ in decades, and I didn’t know they’d added lambda functions/expressions, in C++11. Apparently you can shorten it further: []{}
minus-squarebleistift2@sopuli.xyzlinkfedilinkEnglisharrow-up2·25 days agoThe intention was to provide a longer version for the first step of the ladder.
function() {}JavaScript can do better than that:
C++:
[](){}Huh, I haven’t looked at C++ in decades, and I didn’t know they’d added lambda functions/expressions, in C++11. Apparently you can shorten it further:
[]{}The intention was to provide a longer version for the first step of the ladder.