Fundamentals Tutorials

JavaScript lets you put any type of value in an `if` statement, not just a boolean. JavaScript's native type coercion then takes over - a "truthy" value is a value that JavaScript's native type coercion converts to true.
JavaScript has 3 logical operators: `&&`, `||`, and `!`. These 3 operators are usually used to structure `if` statements, but they also have some unique quirks that you can take advantage of. Here's what you need to know.
JavaScript type coercion is full of surprises, but if you understand the basics it can save you a lot of wasteful type checks. Here is what you need to know about falsy values.
The `filter()` function in JavaScript lets you filter out array elements that don't match certain criteria. Here's what you need to know.
JavaScript doesn't have a built-in `sleep()` function, but that doesn't mean you can't pause a function in JavaScript.
Cross-Origin Resource Sharing, or CORS for short, is a protocol for a browser to determine whether it is safe to make a request to a different domain. Here's what you need to know.
Plain old JavaScript objects are the most common way to store user-entered data in JavaScript. But how do you actually define a POJO?
The `then()` function is the primary way you interact with promises in JavaScript, including promise chaining.
A promise is an object that represents an asynchronous operation. Promises are JavaScript's fundamental concurrency primitive - here's what you need to know.
The `instanceof` operator tells you whether a given object is an instance of a class.
As of ES6 / 2015, JavaScript has a built-in `class` keyword for object-oriented programming. Here's how it works.
The `JSON.stringify()` function is the canonical way to convert a JavaScript object to a JSON string. This tutorial explains `JSON.stringify()` from a practical perspective with examples.
The `seal()` function prevents adding or removing properties from an object, while still letting you modify existing properties. Here's what you need to know.
JavaScript uses prototype-based inheritance, even when you use the ES6 class `extends` keyword. Here's what you need to know about prototypes.
In JavaScript, you often hear the terms "deep clone" and "shallow clone", also known as deep/shallow copy. This tutorial describes what these terms mean with examples.
The `Object.assign()` function lets you assign properties from one object to another. You can use it to shallow copy objects or assign multiple properties at once.
You can concatenate strings in JavaScript using the `+` operator, the `Array#join()` function, or the `String#concat()` function. Here's what you need to know.
How to convert the string "dog" to "Dog" in JavaScript.
The void operator in JavaScript is a common source of confusion because it is rarely taught, but has a couple of convenient uses. This tutorial explains the most common use cases for the void operator.
Many frameworks, like Vue, allow you to embed JavaScript expressions in HTML. But what is an expression? Can you put `if` statements in an expression?
The push() method adds an element to the end of a JavaScript array. This tutorial will show you how push() works.
There are two common ways to check if a JavaScript array contains a value: `includes()` and `indexOf()`. This tutorial shows you how to use both, and why you would use one versus the other.
Arrow functions let you write functions more concisely, but come with several syntactic quirks. This tutorial describes what you need to know to use arrow functions effectively.
The `const` keyword in JavaScript does not prevent you from changing an object's properties. The Object.freeze() function does that, but comes with caveats.
"use strict" enables strict mode in JavaScript. This tutorial explains what strict mode does for you.
The term "callback" can mean one of a few different concepts in JavaScript. This tutorial will help you wrap your mind around callbacks.
An introduction to how to use Object.keys() in JavaScript
A tutorial on how to use `splice()` to add and remove elements from JavaScript arrays
There are 3 ways to get a substring of a string in JavaScript. In this tutorial, you will learn the difference between `String#substring()`, `String#substr()`, and `String#slice()`
Learn how to replace all instances of a given substring in a JavaScript string
Learn how to use the built-in `Array#sort()` function in JavaScript
Learn how to use ES6 maps in JavaScript
Learn how to compare two strings in JavaScript: whether one string is greater than, less than, or equal to the other.
Learn how to check if a string contains a substring in vanilla JavaScript
Learn how to iterate nested arrays, object keys, and other values using forEach() in JavaScript
Learn about the different ways to check if an object contains a given key in JavaScript
Learn about formatting dates using the `toLocaleString()` function, with no outside libraries
Use Mathjs to calculate standard deviation in Node.js and the browser.
Learn what String valueOf(), Number valueOf(), and Date valueOf() have in common.
Learn how to get the current Unix time in JavaScript.