snippetjavascriptTip
JavaScript Operator Cheatsheet
Viewed 0 times
operatorjavascriptcheatsheet
Problem
> [!IMPORTANT]
>
> This article serves as a quick reference for JavaScript's symbolic operators, helping newcomers to the language by giving them an easily searchable name for them. If you're looking for the full operator reference for the language, you should probably check out the MDN Web Docs.
The assignment operator (
JavaScript equality comes in two flavors:
>
> This article serves as a quick reference for JavaScript's symbolic operators, helping newcomers to the language by giving them an easily searchable name for them. If you're looking for the full operator reference for the language, you should probably check out the MDN Web Docs.
The assignment operator (
=) assigns a value to a variable.JavaScript equality comes in two flavors:
Solution
let x = 5; // Assigns the value 5 to x> This article serves as a quick reference for JavaScript's symbolic operators, helping newcomers to the language by giving them an easily searchable name for them. If you're looking for the full operator reference for the language, you should probably check out the MDN Web Docs.
The assignment operator (
=) assigns a value to a variable.JavaScript equality comes in two flavors:
==(loose equality) &!=(loose inequality)===(strict equality) &!==(strict inequality)
@Further reading
Code Snippets
let x = 5; // Assigns the value 5 to x// Loose equality
10 == '10'; // true
10 != '10'; // false
// Strict equality
10 === '10'; // false
10 !== '10'; // trueconst a = 5;
const b = 10;
a > b; // false
a < b; // true
a >= b; // false
a <= b; // trueContext
From 30-seconds-of-code: operator-cheatsheet
Revisions (0)
No revisions yet.