JS is a high level OOP (Object Oriented Programming) language, which means many of the same programing paradigms you are familiar with in other languages (like Python) have a beautiful JS equivalent. Thus, we've created this nifty 1 to 1 guide to help get you up in running in JS.
Variables
im_a_variable = 1;
const UNCHANGING = "I don't change";
const myFunc = (a) => (a + 1);
let iCanChange = 1;
Comments
# Go ahead, make my day.
"""
Go ahead,
make my day.
"""
// That's my secret, I'm always angry.
/*
That's my secret,
I'm always angry.
*/
Console
print("I feel the need - the need for speed!")
>>> I feel the need - the need for speed!
console.log("I feel the need - the need for speed!");
>>> I feel the need - the need for speed!
Whitespace
def fn1():
return 0
fn1()
fn2()
function fn1() { return 0; }
fn1(); fn2();
Logical operators
a = True and False
b = True or False
c = not True