NaijaScript Playground
NaijaScript Quick Reference
- make: Declare variable.
make age get 20
- get: Assign value.
age get 21
-
shout(...): Print to output.
shout("Wetin dey!")
-
if to say (...): Conditional.
if to say (age pass 18) start ... end
-
if not so: Else block.
if not so start ... end
-
jasi (...): Loop.
jasi (count small pass 5) start ... end
- start ... end: Code block.
start ... end
-
do (...): Define function.
do sum(a, b) start return a add b end
-
return: Return from function.
return value
- Comments:
# This na comment
- Numbers:
make pi get 3.142
- Strings:
make name get "Naija"
- Booleans:
make ok get true
-
Operators:
add
(+), minus
(-),
times
(*), divide
(/),
mod
(%)
-
Comparison:
na
(==), pass
(>),
small pass
(<)
-
Logic:
and
, or
, not