Print the Fibonacci series (the first 10 values) separated by spaces. If you've ever taken a Computer Science class, you should be all over this one.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// This should do a pretty good job of iterating through the following array | |
// and logging any values that == each other. Beware, this is scary stuff! | |
// http://benalman.com/news/2010/11/schrecklichwissen-terrible-kno/ | |
var arr = [true, 123, {}, {a:1}, [], [0], [123], "hi", function foo(){}, | |
/re/, false, 0, "", null, undefined, NaN]; | |
function pretty(v) { | |
var s = JSON.stringify(v); | |
return v == null ? v + "" : s === undefined ? v : s == "null" ? "NaN" : s; |