AssemblyScript is a programming language created in 2017.
#550on PLDB | 6Years Old | 16.0kUsers |
0Books | 0Papers |
A TypeScript-like language for WebAssembly.
/** Calculates the n-th Fibonacci number. */
export function fib(n: i32): i32 {
var a = 0, b = 1
if (n > 0) {
while (--n) {
let t = a + b
a = b
b = t
}
return b
}
return a
}