JS Language

Summary An overview of JavaScript syntax. If you are a beginner, read this before the JS Algos file. Variables, Types, and Comments JavaScript stores information (called values) within let and const variables – const variables cannot be changed, but let variables can be reassigned later. Variables can contain booleans (true or false), strings (of text), or numbers, or have null or undefined values. Booleans, strings, numbers, null, and undefined are called types, and can be detected by the typeof command.
Read more →

JS Algos

Summary A review of algorithm implementation in JavaScript. Adapted from the Tech Interview Handbook and the LeetCode website. If you are a JavaScript beginner, read JS Language first. Arrays To efficiently find indexes of two array values that sum to a target, create a map, then iterate linearly. At every index, if target - value is a map key, return the current index, and the index under the map key. Otherwise, add value as a key to the map, pointing to the current index.
Read more →