thedaviddias /
Front-End-Checklist
๐ The essential checklist for modern web development, for humans and AI agents
89/100 healthLoading repository dataโฆ
AbhigyanLabs / repository
JavaScript resources for learners ๐ Tutorials, exercises & projects ๐ฅ๏ธ๐ก Level up your JS skills! ๐ฏโจ You can practise the javascript by the link provided below..
A transparent discovery signal based on current public GitHub metadata.
This score does not audit code, security, maintainers, documentation quality, or suitability. Verify the repository and its current documentation before adoption.
Notes repo. for JavaScript tutorial.
In JavaScript, scope means where in your code a variable or function can be accessed.
let name = "Abhigyan"; // global
console.log(name); // โ
accessible here
function greet() {
console.log(name); // โ
accessible inside functions too
}
var, let, const) are only accessible in that function.function test() {
let x = 10;
console.log(x); // โ
works
}
console.log(x); // โ Error: x is not defined
let or const inside {} are only accessible inside that block.if (true) {
let y = 5;
console.log(y); // โ
works here
}
console.log(y); // โ Error: y is not defined
varignores block scope and leaks outside the block (old JS behavior).
function outer() {
let a = "Outer Var";
function inner() {
console.log(a); // โ
can access outer variable
}
inner();
}
outer();
JavaScript has 8 main data types โ split into primitive and non-primitive.
In JavaScript, primitive and non-primitive (reference) types are categorized based on how the data is stored and accessed in memory.
Thatโs why primitives are copied by value, while non-primitives are copied by reference.
String โ text data
let name = "Abhigyan";
Number โ integers & decimals (no separate int/float)
let age = 20;
Boolean โ true or false
let isStudent = true;
Undefined โ declared but not assigned
let city;
Null โ intentional empty value, also a standalone value.
let price = null;
Symbol โ unique identifier, used for uniqueness
let id = Symbol("id");
BigInt โ large integers beyond Number limits
let bigNum = 123456789012345678901234567890n;
Object โ collections of keyโvalue pairs, arrays, functions, etc.
let user = { name: "Abhigyan", age: 20 };
In JavaScript, reference data types (non-primitives) store a memory reference to the actual data in the heap.
Key points:
=== is false, even if they have the same content.Example:
let a = { name: "Abhigyan" };
let b = a;
b.name = "Alex";
console.log(a.name); // "Alex" (because a and b reference same object)
That means you donโt need to declare the data type of a variable; the type is determined at runtime based on the value assigned, and it can change later.
Example:
let x = 5; // number
x = "Hello"; // now a string
In JavaScript (and most programming languages), stack and heap are two different areas of memory with different purposes:
string, number, boolean, null, undefined, symbol, bigint).Example (code):
let youtubename = "AbhigyanLabs"; // stored directly in stack
let anothername = youtubename; // a copy is made
anothername = "Tech Incarnate"; // only this copy changes
console.log(youtubename); // "AbhigyanLabs"
console.log(anothername); // "Tech Incarnate"
object, array, function, etc.).Example (code):
let userOne = {
email: "abhigyan@google.com",
age: 22
};
let userTwo = userOne; // both point to same heap object
userTwo.email = "vidyanshu@google.com"; // changes the shared object
console.log(userOne.email); // "vidyanshu@google.com"
console.log(userTwo.email); // "vidyanshu@google.com"
โ Quick Summary
| Feature | Stack | Heap |
|---|---|---|
| Stores | Primitives | Objects & functions |
| Access speed | Fast | Slower |
| Storage type | Value | Reference |
| Size | Fixed | Dynamic |
JS Comparison vs Equality
Comparison (<, >, <=, >=) โ Converts to numbers
null โ 0undefined โ NaN (always false)Loose equality (==) โ Type conversion
null == undefined โ truenull only equals itselfStrict equality (===) โ No conversion
In modern JavaScript, template literals (${}) are preferred over string concatenation with +.
Example:
// Using +
let name = "Abhigyan";
let greeting = "Hello, " + name + "!";
console.log(greeting); // Hello, Abhigyan!
// Using template literal
let greeting2 = `Hello, ${name}!`;
console.log(greeting2); // Hello, Abhigyan!
Why ${} is better:
In short: always prefer `${}` over + concatenation in modern JS.
Number.MAX_VALUE โ largest positive number (~1.79e308)Number.MIN_VALUE โ smallest positive number (>0, ~5e-324)Number.MAX_SAFE_INTEGER โ 9007199254740991Number.MIN_SAFE_INTEGER โ -9007199254740991Number.isNaN(value) โ checks if value is NaN (better than isNaN() global).Number.isFinite(value) โ checks if value is a finite number.parseInt("42") โ converts string to integer.parseFloat("42.5") โ converts string to floating number.toFixed(n) โ formats number to n decimal places (returns string).Math.PI โ 3.141592653589793
Math.abs(x) โ absolute value.
Math.round(x) โ rounds to nearest integer.
Math.ceil(x) โ rounds up.
Math.floor(x) โ rounds down.
Math.trunc(x) โ removes decimal without rounding.
Math.sqrt(x) โ square root.
Math.pow(a, b) โ a raised to power b (a ** b is shorter).
Math.random() โ random number 0 โค x < 1.
Random in range:
Math.floor(Math.random() * (max - min + 1)) + min
Math.min(...values) / Math.max(...values) โ smallest/largest value.
Math.sign(x) โ returns 1, -1, or 0 depending on sign of x.
๐ก Tip: Avoid direct equality checks with floating-point numbers (0.1 + 0.2 === 0.3 โ false). Use a small tolerance:
Math.abs(0.1 + 0.2 - 0.3) < Number.EPSILON
Number.MAX_VALUE โ Largest positive number JS can represent.Number.MIN_VALUE โ Smallest positive number (closest to 0).Number.MAX_SAFE_INTEGER โ Largest integer that can be represented safely (2^53 - 1).Number.MIN_SAFE_INTEGER โ Smallest safe integer (-(2^53 - 1)).Number.EPSILON โ Smallest difference between two representable numbers.parseInt("42") โ Converts string to integer (42).parseFloat("42.5") โ Converts string to floating number (42.5).Number(value) โ Converts any value to number.value.toFixed(n) โ Formats number with n decimal places.Math.round(x) โ Rounds to nearest integer.Math.ceil(x) โ Rounds up.Math.floor(x) โ Rounds down.Math.trunc(x) โ Removes decimal part.Math.random() โ Returns a pseudo-random number 0 โค x < 1.
Range Formula:
Math.floor(Math.random() * (max - min + 1)) + min
โ Random integer between min and max (inclusive).
Math.pow(a, b) / a ** b โ Exponentiation.Math.sqrt(x) โ Square root.Math.cbrt(x) โ Cube root.Math.min(...values) โ Smallest value.Math.max(...values) โ Largest value.Math.sign(x) โ Returns -1, 0, or 1 depending on sign.Number.isFinite(x) โ Checks if value is finite.Number.isNaN(x) โ Checks if value is NaN.Floating-point precision check:
Math.abs(0.1 + 0.2 - 0.3) < Number.EPSILON
// true
Date is an object For rest refer to code file. It has commented and explained content.
Shallow Copy: Changes in nested objects/arrays of the copy also affect the original. Only top-level changes are independent.
Deep Copy: Changes in the copy do NOT affect the original, even for nested objects/arrays.
slice() โ returns a new array, original unchanged. splice() โ changes the original array (remove/add elements).
Example:
let arr = [1,2,3,4];
arr.slice(1,3); // [2,3], arr unchanged
arr.splice(1,2); // removes 2 & 3, arr = [1,4]
const arr1 = [1, 2, 3];
const arr2 = new Array(4, 5, 6);
arr[0], arr[1]โฆ| Method | Description |
|---|---|
push() | Add element at end |
pop() | Remove element from end |
unshift() | Add element at start |
shift() | Remove element from start |
let arr = [1,2,3,4];
arr.slice(1,3); // [2,3], original unchanged
arr.splice(1,2); // removes 2 & 3, arr = [1,4]
...) โ combine multiple arrays easily.const combined = [...arr1, ...arr2];
let arr = [1,[2,3,[4]]];
arr.flat(2); // [1,2,3,4]
| Method | Description |
|---|---|
Array.isArray() | Check if a value is an array |
Array.from() | Convert iterable (string, etc.) to array |
Array.of() | Create array from arguments |
Array.from("Hello"); // ['H','e','l','l','o']
Array.of(1,2,3); // [1,2,3]
โ Tips
... is handy for combining arrays.flat() for nested arraysSelected from shared topics, language and repository descriptionโnot editorial ratings.
thedaviddias /
๐ The essential checklist for modern web development, for humans and AI agents
89/100 healthunicodeveloper /
:notebook_with_decorative_cover: :books: A curated list of awesome resources : books, videos, articles about using Next.js (A minimalistic framework for universal server-rendered React applications)
79/100 healthgreatfrontend /
Curated front end system design resources for interviews and learning
94/100 healthdzharii /
A collection of awesome TypeScript resources for client-side and server-side development. Write your awesome JavaScript in TypeScript
32/100 healthDylan-Israel /
A collection of the best resources for programming, web development, computer science and more.
80/100 healthbtroncone /
Clear examples, explanations, and resources for RxJS
92/100 health