Fun little puzzles. First 4 went pretty quickly (~8:00) and then the last one took ~7 minutes Googling around for this so I could test if a variable was an integer... n===+n && n===(n|0) Wish I could see my answers after the fact though! Edit: Read the initial requirements of the puzzle, it says sum all the integers , not all the numbers . People using (typeof i[x] == 'number') just got lucky because the test-cases d…
typeof n === 'number' It didn't actually require differentiating between integers and floats, just numbers and other types.
You Can't JavaScript Under Pressure
31–40 of 110 posts
Re: You Can't JavaScript Under Pressure
#32Earlier quoted context omitted.
typeof n === 'number' It didn't actually require differentiating between integers and floats, just numbers and other types.
> typeof 5.4 "number"
I mentally skipped over Justin_Time's solution, figuring I would just hit a float error case because it was going to be a stickler about integers.
Re: You Can't JavaScript Under Pressure
#33That was fun! I just got in to work so I was properly sleeping. I also rarely use typeof, so I had to look up that 'integer' and 'array' do not exist :) Also, what was really annoying is the use of 'i' for the argument. That's what I exclusively use for the 'for loop' index! Tripped me up a lot, I had to consciously remind myself every time I accessed the array. Last 'also', the font is WAY too big for my small scree…
Re: You Can't JavaScript Under Pressure
#34What's everyone's times? I did 7 minutes
Re: You Can't JavaScript Under Pressure
#35Earlier quoted context omitted.
Because of your comment, HN will have a dozen "I am so disappointed in all of you" posts in the coming week declaring how mean everyone here is, and how it is no longer like it "once was". I hope you are happy.
I'd be happier if this page hadn't blasted music into my conference call.
Re: You Can't JavaScript Under Pressure
#36What's everyone's times? I did 7 minutes
Re: You Can't JavaScript Under Pressure
#37Earlier quoted context omitted.
Because of your comment, HN will have a dozen "I am so disappointed in all of you" posts in the coming week declaring how mean everyone here is, and how it is no longer like it "once was". I hope you are happy.
I'd be happier if this page hadn't blasted music into my conference call.
Re: You Can't JavaScript Under Pressure
#38Earlier quoted context omitted.
I'd be happier if this page hadn't blasted music into my conference call.
Your fault for not paying attention during a conference call...
Re: You Can't JavaScript Under Pressure
#39Thanks for immediately playing audio without asking me first. I know everybody just loves it when web pages do that.
Because of your comment, HN will have a dozen "I am so disappointed in all of you" posts in the coming week declaring how mean everyone here is, and how it is no longer like it "once was". I hope you are happy.
Re: You Can't JavaScript Under Pressure
#40What's everyone's times? I did 7 minutes
I wanna see one of these in Python.