JavaScriptクイズ「x + 0 == x - 0」
以下の20問のconsole.logで何が出力されるか当ててみよう。
var x = {}; console.log(x + 0 == x - 0) var x = []; console.log(x + 0 == x - 0) var x = (function(){}); console.log(x + 0 == x - 0) var x = null; console.log(x + 0 == x - 0) var x = undefined; console.log(x + 0 == x - 0) var x = Infinity; console.log(x + 0 == x - 0) var x = Array; console.log(x + 0 == x - 0) var x = 0; console.log(x + 0 == x - 0) var x = false; console.log(x + 0 == x - 0) var x = NaN; console.log(x + 0 == x - 0) var x = ""; console.log(x + 0 == x - 0) var x = "a"; console.log(x + 0 == x - 0) var x = "0"; console.log(x + 0 == x - 0) var x = "1"; console.log(x + 0 == x - 0) var x = "0.1"; console.log(x + 0 == x - 0) var x = "0x"; console.log(x + 0 == x - 0) var x = "."; console.log(x + 0 == x - 0) var x = " "; console.log(x + 0 == x - 0) var x = Array(); console.log(x + 0 == x - 0) var x = (function(){}()); console.log(x + 0 == x - 0)
自分で問題を作ったのに3問間違えた…
追記: 18問だと切りが悪いので2個足して20問にしました。1問5点で。