val vs var

kotlinJS
valconst
varlet

a..b

kotlinJS
a..bArray(b-a+1).fill(0).map(i => i + a)

when

kotlin

fun main (){
	val luckyNum = 4
	val yourNum = (1..6).random()
	val result = when(yourNum){
		luckyNum -> "You get the lucky num ${luckyNum}"
		1 -> "Sorry, you get 1"
		2 -> "Sorry, you get 2"
		3 -> "Sorry, you get 3"
		4 -> "Sorry, you get 4"
		5 -> "Sorry, you get 5"
		6 -> "Sorry, you get 6"
		else -> "Sorry, you get a number out of 1..6"
	}
	println(result)
}