You Can't JavaScript Under Pressure
51–60 of 110 posts
Re: You Can't JavaScript Under Pressure
#52nice stuff but this is plain wrong! // return the file extension (with no period) if it has one, otherwise false its like returning error codes in C for errors
Re: You Can't JavaScript Under Pressure
#53What's everyone's times? I did 7 minutes
Re: You Can't JavaScript Under Pressure
#54Fun 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…
n % 1 == 0
Re: You Can't JavaScript Under Pressure
#55Thanks for immediately playing audio without asking me first. I know everybody just loves it when web pages do that.
Re: You Can't JavaScript Under Pressure
#56It's problems like 5 that make me sad that IE return i.reduce(function(prev, next) { if (typeof(next) == "object" && next.length) { return arraySum(next) + prev; } if (typeof(next) == "number") { return next + prev; } return prev; }, 0); Something that simple needs to be shimmed on earlier IEs. In fact, I had to look up Array.prototype.reduce for this since I usually use Underscore's. Javascript problems...
Re: You Can't JavaScript Under Pressure
#57It was a kinda cool thing, although I got some strange behavior when I was using `match` for determining whether the input is a filename - my regex was /. \.. / (and so I did var match = i.match(/. \.. /) ), and match[1] was undefined - turned out match[2] was what I wanted, and it was present, but the behavior was incorrect in the reporting console in the game. I finished this in 4 minutes. Edit: looks like HN doesn…
return input.split(".")[1] || "";
Re: You Can't JavaScript Under Pressure
#58What's everyone's times? I did 7 minutes
Re: You Can't JavaScript Under Pressure
#59Fun 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…