Cipherd@lemmy.ml to Programmer Humor@lemmy.ml · 4 days agofunctionslemmy.mlimagemessage-square37linkfedilinkarrow-up1290arrow-down14
arrow-up1286arrow-down1imagefunctionslemmy.mlCipherd@lemmy.ml to Programmer Humor@lemmy.ml · 4 days agomessage-square37linkfedilink
minus-squaredavel@lemmy.mllinkfedilinkEnglisharrow-up14arrow-down1·4 days agoJavaScript can do better than that: () => {}
minus-squaredavel@lemmy.mllinkfedilinkEnglisharrow-up4·4 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·4 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.