2009-09-25 分岐のwhen構文 cathand when {number => "this is number", string => "this is string"} function output(x) { alert("output: " + x); }if (typeof input === 'number') { output("this is number") } else if (typeof input === 'string') { output ("this is string") }