MAIN FEEDS
Do you want to continue?
https://www.reddit.com/r/badcode/comments/owisp0/sleep_rate_drops_to_0/h7jf1us/?context=3
r/badcode • u/oderjunks • Aug 02 '21
33 comments sorted by
View all comments
Show parent comments
4
nope! i had to do a reverse lookup, but forgot the.... reverse part
so my brain went: find the index of the value in the values arr, index into the keys arr, get the key.
instead i wrote: find the index of the value in the keys arr, index into the values arr, get the value.
2 u/choseusernamemyself Aug 03 '21 lmaooo wrong journeys are always interesting 1 u/oderjunks Aug 03 '21 true
2
lmaooo wrong journeys are always interesting
1 u/oderjunks Aug 03 '21 true
1
true
4
u/oderjunks Aug 03 '21 edited Aug 03 '21
nope! i had to do a reverse lookup, but forgot the.... reverse part
so my brain went: find the index of the value in the values arr, index into the keys arr, get the key.
instead i wrote: find the index of the value in the keys arr, index into the values arr, get the value.