cm0002@lemmy.world to Programmer Humor@programming.dev · 1 month agoJavaScriptlemmy.mlimagemessage-square156fedilinkarrow-up1899arrow-down113
arrow-up1886arrow-down1imageJavaScriptlemmy.mlcm0002@lemmy.world to Programmer Humor@programming.dev · 1 month agomessage-square156fedilink
minus-squaregrue@lemmy.worldlinkfedilinkarrow-up4·1 month agoWhich “1” did it remove? And did it search the string to find a “1” to remove, or did it remove whichever character happened to be at array index 1?
minus-square⛓️💥@sh.itjust.workslinkfedilinkEnglisharrow-up10·1 month agoThe one at the end. Subtraction is the opposite of addition. If addition adds a character to the end of the string, it must follow that subtraction would remove a character from the end of the string.
minus-squareRevan343@lemmy.calinkfedilinkarrow-up3·1 month agoThis is how we end up with an endian schism
minus-squareanton@lemmy.blahaj.zonelinkfedilinkarrow-up2·1 month agomaybe we removed the last n characters
minus-squareFooBarrington@lemmy.worldlinkfedilinkarrow-up2·1 month agoIt should just randomly pick any “1”. Add a bit of spice, you know
Which “1” did it remove? And did it search the string to find a “1” to remove, or did it remove whichever character happened to be at array index 1?
The one at the end. Subtraction is the opposite of addition. If addition adds a character to the end of the string, it must follow that subtraction would remove a character from the end of the string.
This is how we end up with an endian schism
maybe we removed the last n characters
It should just randomly pick any “1”. Add a bit of spice, you know