home > 比較編 > JavaScript, Lua, Io > execution control >

ForNext

Only Do What Only You Can Do

106. if

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
  )
)

VBScript

Perl

PHP

Python

Ruby

PowerShell

Scala

F#

C

C++

C++Builder

VC++

C#

Java

Objective-C

D

VB

VB.NET

Delphi

Ada

PL/SQL

T-SQL

関数型

inserted by FC2 system