ForNext
Only Do What Only You Can Do
106. if
Hyperpolyglot Interpreted Languages: Tcl, Lua, JavaScript, Io より (2012.05.08)
JavaScript
if (0 == n) { alert("no hits"); } else if (1 == n) { alert("1 hit"); } else { alert(n + " hits"); }
Lua
if n == 0 then print("no hits") elseif n == 1 then print("one hit") else print(n .. " hits") end
Io
if (n == 0, "no hits", if (n == 1, "1 hit", "#{n} hits" interpolate ) )