Cipherd@lemmy.ml to Programmer Humor@lemmy.ml · 3 days agofunctionslemmy.mlexternal-linkmessage-square36fedilinkarrow-up1276arrow-down15
arrow-up1271arrow-down1external-linkfunctionslemmy.mlCipherd@lemmy.ml to Programmer Humor@lemmy.ml · 3 days agomessage-square36fedilink
minus-squaredavel [he/him]@lemmy.mllinkfedilinkEnglisharrow-up12arrow-down1·3 days agoJavaScript can do better than that: () => {}
minus-squaredavel [he/him]@lemmy.mllinkfedilinkEnglisharrow-up3·edit-23 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·3 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.