Definition
A high-level programming language, so it’s accessible. Follows the ECMAScript standard. Some key features: Dynamic typing, Use of Prototypes for Objects, Functions can be Variables
Info
…
JS is hell by the way
Data: Numbers, Booleans, Strings
- Arithmetic operations:
+, -, *, /, %
. Supports parenthesis()
for priority-setting. - Boolean
true | false
- Strings can be created with
'
or"
- Concatenation:
"Wow " + "that's crazy."
|"Numbers 6, 7, " + 8 + 9
|"Hi pls " + ["be in", "order", "!?"]
Logic
- “Not” this, or check if nonexistent →
!false
,!data
- Conditions:
===
,!==
,<
,>
,<=
,>=
- Null
- Undefined → is a value, but it also means there’s no other value
- Falsy → false, undefined, NaN, null, 0, "",
Objects
…
Built-in Functions
.substring(0, 7);
→ specified section of a string.charAt(2);
→ char in a string at particular pos.length;
→ length
Reminders
- Statements are terminated with
;
but this is not strictly enforced. Do it anyway. ==
invokes type coercion."0"
is truthy.- Not declaring a variable with
var
makes it declare globally.
Game Development
Used in the Past
Ct.js - not using this again, does not warrant a page.
Javascript Libraries
- React
- Vue
- Angular
- Svelte