@[email protected] to Programmer [email protected] • 16 days agoJavaScriptlemmy.mlimagemessage-square157fedilinkarrow-up1727cross-posted to: [email protected]
arrow-up1727imageJavaScriptlemmy.ml@[email protected] to Programmer [email protected] • 16 days agomessage-square157fedilinkcross-posted to: [email protected]
minus-square@[email protected]linkfedilink4•16 days 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⛓️💥linkfedilinkEnglish7•16 days 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-square@[email protected]linkfedilink4•16 days agoIt should just randomly pick any “1”. Add a bit of spice, you know
Should it, or should it be “1”? (just removing one, one)
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
It should just randomly pick any “1”. Add a bit of spice, you know
maybe we removed the last n characters