Notes

How to learn effectively

Learning: The acquisition of skills and the ability to apply them in the future.

What makes an Effective learner?

Why do active learning techniques feel difficult?

Desirable Difficulty

Effective learners space their practice


Hello World

“Simplicity is prerequisite for reliability.” – Edsger W. Dijkstra


The Number Data Type

The number data type in JS is used to represent any numerical values, including integers and decimal numbers.

Basic Arithmetic Operators

Operators are the symbols that perform particular operations.

JS evaluates more complex expressions using the general math order of operations aka PEMDAS.

Modulo : Very useful operation to check divisibility of numbers, check for even & odd, whether a number is prime, and much more! (Discrete Math concept, circular problems can be solved with modulo)


The String Data Type

The string data type is a primitive data type that used to represent textual data.


The Boolean Data Type

The boolean data type is the simplest data type since there are only two values: true and false.

Comparison Operators

All comparison operators will result in a boolean output.

The relative comparators

Fun Fact: “a” < “b” is considered valid JS Code because string comparisons are compared lexicographically (meaning dictionary order), so “a” is less than “b” because it appears earlier!

If there is ever a standstill comparison of two string lexicographically (i.e. app vs apple) the comparison will deem the shorter string lesser.

Difference between == and ===


Variables

Variables are used to store information to be referenced and manipulated in a program.

Assignment Shorthand

let num = 0;
num += 10; // same as num = num + 10
num -= 2; // same as num = num - 2
num /= 4; // same as num = num / 4
num *= 7; // same as num = num * 7

Functions

A function is a procedure of code that will run when called. Functions are used so that we do not have to rewrite code to do the same thing over and over. (Think of them as ‘subprograms’)


Parameters and Arguments