Cipherd@lemmy.ml to Programmer Humor@lemmy.ml · 8 hours agofunctionslemmy.mlimagemessage-square16fedilinkarrow-up1141arrow-down11
arrow-up1140arrow-down1imagefunctionslemmy.mlCipherd@lemmy.ml to Programmer Humor@lemmy.ml · 8 hours agomessage-square16fedilink
minus-squaredavel [he/him]@lemmy.mllinkfedilinkEnglisharrow-up8arrow-down1·8 hours agoJavaScript can do better than that: () => {}
minus-squaredavel [he/him]@lemmy.mllinkfedilinkEnglisharrow-up2·edit-27 hours 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·8 hours 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.