Functions in JavaScript

Pro Members Only

This lesson is available if you have an active subscription.

Alternatively, some member might be able to gift it to you.

If you already have a subscription, you can sign in.

Professional Modern JavaScript Lessons

1.Course Intro
free
⏱️ 1:13
2.Setup & Tooling
free
⏱️ 3:32
3.Debugger Statements and Breakpoints
free
⏱️ 2:17
4.Primitive Data Types and Values
free
⏱️ 3:06
5.JavaScript Variables - let and const
free
⏱️ 4:50
6.Comments in JavaScript
free
⏱️ 2:55
7.JavaScript Identifer Naming
free
⏱️ 2:52
8.Using TypeScript
free
⏱️ 4:26
9.JavaScript String Masterclass
free
⏱️ 9:29
10.JavaScript Boolean Type
⏱️ 6:45
11.Missing Guide to JavaScript Numbers
⏱️ 15:28
12.JavaScript Objects Demystified
⏱️ 13:33
13.Functions in JavaScript
⏱️ 20:25
14.JavaScript Arrays Masterclass
⏱️ 22:31
15.JavaScript If Else Statements and Best Practices
⏱️ 6:13
16.JavaScript Conditional Expressions
⏱️ 8:38
17.JavaScript Loose vs Strict Equality
⏱️ 4:02
18.Truthy vs Falsy in JavaScript
⏱️ 3:44
19.Concept of JavaScript Nullish and Unification
⏱️ 5:51
20.JavaScript Classes - Object Oriented Programming
⏱️ 10:30
21.JavaScript Error Handling and Exceptions
⏱️ 13:21
22.JavaScript Nullish Operators
⏱️ 5:48
23.JavaScript Switch Statement Masterclass
⏱️ 8:07
24.JavaScript For Loop Iteration Simplified
⏱️ 10:59
25.JSON Masterclass
⏱️ 7:59
26.JavaScript While and Do While Loops
⏱️ 2:52
27.JavaScript Date and Time Simplified
⏱️ 13:16
28.this in JavaScript
⏱️ 12:04
29.JavaScript Tagged Templates Masterclass
⏱️ 5:48
30.Promises in JavaScript
⏱️ 10:01
31.JavaScript Async Await Masterclass
⏱️ 9:00
32.JavaScript Symbols Demystified
⏱️ 7:25
33.JavaScript Iterators and Iterables
⏱️ 8:50
34.JavaScript Generators Simplified
⏱️ 9:17
35.JavaScript Prototype - The Secret Guide
⏱️ 11:21
36.JavaScript Set Builtin Data Structure
⏱️ 9:52
37.JavaScript Map Builtin - HashMap Magic
⏱️ 10:38
38.JavaScript Deferred Promise Pattern - withResolvers
⏱️ 3:35
39.Cloning and Deep Copying in JavaScript
⏱️ 3:14
40.JavaScript Async Await Sequencing and Execution Masterclass
⏱️ 10:31
41.JavaScript Memory Management Masterclass
⏱️ 5:26
42.JavaScript WeakMap Demystified
⏱️ 8:58
43.JavaScript bigint Masterclass
⏱️ 5:35
44.JavaScript WeakSet Explained with Examples
⏱️ 7:47
45.JavaScript Regular Expressions Masterclass
⏱️ 17:54
46.JavaScript Weak References Demystified
⏱️ 5:29
47.JavaScript Memory Leaks Demonstrations and Fixes
⏱️ 6:01
48.Semicolon Free Coding in JavaScript
⏱️ 3:46
49.JavaScript Modules Masterclass
⏱️ 11:36

Functions in JavaScript

Subscription Required

You must have an active subscription to access this content.
If you already have a subscription, you can sign in.

Introduction

function calculateDiscountedValue(value, percentDiscount) {
const result = value - (value * percentDiscount / 100);
return result;
}

let discountedValue;

discountedValue = calculateDiscountedValue(123, 10);
console.log(discountedValue); // 110.7

discountedValue = calculateDiscountedValue(456, 10);
console.log(discountedValue); // 410.4

Hoisting

let discountedValue;

discountedValue = calculateDiscountedValue(123, 10);
console.log(discountedValue); // 110.7

discountedValue = calculateDiscountedValue(456, 10);
console.log(discountedValue); // 410.4

function calculateDiscountedValue(value, percentDiscount) {
const result = value - (value * percentDiscount / 100);
return result;
}

Argument Count

Too many arguments

function calculateDiscountedValue(value, percentDiscount) {
const discountedValue = value - (value * percentDiscount / 100);
return discountedValue;
}

console.log(calculateDiscountedValue(50, 10, 'extra')); // 45, 'extra' is unused

Missing Arguments

function calculateDiscountedValue(value, percentDiscount) {
console.log(percentDiscount); // undefined
const discountedValue = value - (value * percentDiscount / 100);
return discountedValue;
}

console.log(calculateDiscountedValue(50)); // NaN

Automatic Return

function sayHi(person) {
const fullName = `${person.firstName} ${person.lastName}`;
console.log(`Hello, ${fullName}!`);
}

sayHi({ firstName: 'John', lastName: 'Doe' }); // Hello, John Doe!

const result = sayHi({ firstName: 'John', lastName: 'Doe' });
console.log(result); // undefined

function sum(a, b) {
const result = a + b;
// Oops forgot 🙈
// return result;
}

console.log(sum(4, 5)); // undefined

Spread Arguments

Math.max(4, 10, 20); // 20

const numbers = [4, 10, 20];

Math.max(numbers[0], numbers[1], numbers[2]); // 20

Math.max(...numbers); // Same as `Math.max(4, 10, 20)` => 20

function example(a, b) {
console.log(`a: ${a}, b: ${b}`);
}

const message = ['hello', 'world'];

example(...message); // a: hello, b: world

First Class Functions

Functions as Expressions

let hello = function example() {
return 'Hello World';
};

// example(); // ReferenceError: example is not defined

hello(); // 'Hello World'

hello = function () {
return 'Hello World';
};

IIFE

Immediately Invoked Function expression

function example() {
console.log('hello');
}
example(); // hello

// IIFE (immediately invoked function expression)

(function () {
console.log('hello');
})(); // hello

Passing Functions

function runTwice(callback) {
callback();
callback();
}

runTwice(function () {
console.log('Hello World');
});

// Hello World
// Hello World

Example built-in API is setTimeout as shown below

setTimeout(function () {
console.log('A second has passed');
}, 1000);

setTimeout(function () {
console.log('Two seconds have passed');
}, 2000);

Arrow functions

let sum;

sum = function (a, b) {
return a + b;
};

sum = (a, b) => {
return a + b;
};

sum = (a, b) => a + b;

let add10;

add10 = (x) => x + 10;

add10 = x => x + 10;

const origin = () => ({ x: 0, y: 0 });

Rest Parameters

Without rest parameters:

function log(a, b) {
console.log(a, b);
}

log(1, 2); // 1 2

log(1); // 1 undefined
log(1, 2, 3); // 1 2

console.log(1); // 1
console.log(1, 2, 3); // 1 2 3

With rest parameters:

function log(...allTheThings) {
console.log(allTheThings);
}

log(1, 2, 3); // [1, 2, 3]

console.log(1, 2, 3); // 1 2 3

function logBetter(...allTheThings) {
console.log(...allTheThings);
// console.log(allTheThings[0], allTheThings[1], ...);
}

logBetter(1, 2, 3); // 1 2 3

Default Parameters

let sum;

sum = (a, b, c) => a + b + c;

sum(1, 2, 3); // 6

sum(1, 2); // NaN

sum = (a = 0, b = 0, c = 0) => a + b + c;

sum(1, 2, 3); // 6

sum(1, 2); // 3

sum(1, undefined, 3); // 4

Pass by Value - vs - Pass by Reference

function tryToReassignPrimitive(input) {
input = 4;
}

let primitive = 3;
tryToReassignPrimitive(primitive);
console.log(primitive); // 3

function tryToReassignObject(input) {
input = { name: 'Kim' };
}

let object = { name: 'John' };
tryToReassignObject(object);
console.log(object); // { name: 'John' }

Pure functions

let count;
function incrementImpure() {
count++;
}

count = 0;
incrementImpure();
console.log(count); // 1

function increment(value) {
return value + 1;
}

count = increment(count);
console.log(count); // 1

Destructuring Arguments

function ranged({ value, min, max }) {
if (value < min) {
return min;
}
if (value > max) {
return max;
}
return value;
}

ranged({ value: 100, min: 0, max: 10 }); // 10

Closures

function counter() {
let count = 0;
return function () {
return count++;
};
}

const inc = counter();
console.log(inc()); // 0
console.log(inc()); // 1
console.log(inc()); // 2

Factory Functions

function createCounter(initial = 0) {
let count = initial;
return {
inc: () => count++,
dec: () => count--,
value: () => count,
reset: (value) => count = value,
}
}

const counter = createCounter();
console.log(counter.value()); // 0

counter.inc();
console.log(counter.value()); // 1

counter.reset(10);
console.log(counter.value()); // 10

Object Method Definition

let catDog;

catDog = {
speak: function () {
console.log('meow 🐱');
console.log('woof 🐶');
}
};

catDog = {
speak() {
console.log('meow 🐱');
console.log('woof 🐶');
}
};

catDog.speak();

Getters and Setters

function createRanged({ value, min, max }) {
return {
get value() {
return value;
},
set value(newValue) {
value = Math.max(min, Math.min(max, newValue));
}
}
}

const ranged = createRanged({ value: 5, min: 0, max: 10 });

console.log(ranged.value); // 5

ranged.value = 15;
console.log(ranged.value); // 10

Recursive Functions

// fibonacci(0) => 0
// fibonacci(1) => 1
// fibonacci(n) => fibonacci(n-1) + fibonacci(n-2)

function fibonacci(n) {
if (n === 0) return 0;
if (n === 1) return 1;
return fibonacci(n - 1) + fibonacci(n - 2);
}

console.log(fibonacci(11)); // 89
javascript
typescript
react
playwright

Enjoy free content straight from your inbox 💌

No spam, unsubscribe at any time.

Transcript

00:00

Within JavaScript functions are the fundamental way of defining reusable code blocks. We've been using functions all along this course, whether it was console log or the various methods that we looked at when working within the TETA types. So in this tutorial, we will kick it up a notch and take a deeper look at how you can create your own functions and lots of the technical features. Even if you've used JavaScript for a while, I can guarantee that you will learn something new in this tutorial. So let's go. Let's first discuss the main objective of functions, and that is code reuse. Consider we have a value and a person discount and we want to calculate the

00:33

discounted value. We can do that quite easily with a JavaScript expression, but if we want to do it again for a different value, we will have to write that expression again and this sort of code is not very maintainable and this is where functions come in. We create a utility called calculated discounted value that takes a value and a person discount calculates the result and returns that from the function. And now whenever we need the discounted value, we simply invoke the calculate discounted value function and it gives us the result that we are looking for. Let's take a deeper look and discuss the various JavaScript syntax elements that

01:07

are at play right now. First up, we have the function declaration. This consists of the function keyword followed by an identifier for the function name followed by the various parameters that the function can accept, followed by a function body that consists of various statements with an optional return statement. To return a value back to the caller to use the function, we make a function call. There are two function calls over here and the structure of the function call consists of the function identifier followed by brackets. We be passing the different arguments that get assigned to the parameters within

01:41

the function. A curious fact about function declarations within JavaScript is that they get hoisted, which means they can be used. For example, we can call them or invoke them before they have been declared. And just like other JavaScript data types, the type of operator is supported for functions as well and it returns to literal string function. JavaScript functions are fairly resilient and they will actually work without throwing an error even in the presence of possible coding mistakes. So even though this function only accepts two parameters, we can actually pass in three arguments and what will happen in this particular case is that the third argument will get unused,

02:16

which is pretty much the same as just putting a random string somewhere in our code. It's not doing any harm, but it's not doing any good either. What is more dangerous is that we might potentially forget to pass in a required parameter. In this particular case, we have forgotten to pass in a percent discount and the JavaScript on time will actually pass in that magical value that we've looked at before called undefined. Additionally, trying to do math between a number and an undefined value will give us another thing that we've looked at before in our number lesson, which is the Nan special type.

02:49

The obvious guidance here is that don't pass in more or less arguments than you need because the towers kept on time may or may not throw you a useful error. Return statements in JavaScript functions are optional, which means that not only can we use functions for calculating results, but we can also use them for carrying out tasks where we do not need a return value. As an example, consider a simple say hi function, whose sole purpose is to log a full name to the console. And of course, if you pass in an object that has the first name and the last name, it'll calculate the full name and lock that out as you would expect.

03:23

What is interesting is that functions always return a result within JavaScript, so we can actually store that result and log it out. And because this function does not have a return statement, JavaScript returns that special value undefined. Now this is perfectly fine as we do not expect this function to return a value. However, it is easy to make a programming mistake where you forget the return statement when you intended one, in which particular case you might end up with an undefined. So obviously don't forget your return statement if you need one. Modern JavaScript offers a special syntax to take a single array argument and

03:57

turn it into multiple parameters that get passed into the function. You might recall the Math Max function from a number lesson which returns the maximum value that exists between the different arguments. Arrays in JavaScript are simple collection of items separated by commas within square brackets, and here we have an array of three items. Now, if you wanted to pass these individual items from the numbers array to math max, we would have to look up the individual items. We would've to look up item zero, then item one, and then item two as different arguments that we send to math dot max. And this is where spread arguments come in.

04:32

We can actually take an array and use the triple.to spread those array members as different arguments that get passed through the function. Just to get a bit more practice with spread arguments, consider a simple example function that takes two values, A and B, and we have a message array that consists of two strings. If you want to pass those two strings into the example, we can take that array and spread it into the different arguments. Within JavaScript Functions are first class. This is a programming language concept, and what this means is that functions can be treated like other data types and moved around as variables and even passed into other functions which are called

05:10

higher order functions. We can actually take a full function declaration and assign it to available, but this will actually not be a function declaration as we saw before. And instead this will be what is known as a function expression. What this means is that the identify for the function, which is example, is not going to become available in this scope. And our only access to this expression is where we assigned it to here, we assigned it to Hello and we can use that to invoke the function. Now, obviously since the function name does not become exposed, it is common to use function expressions without a name and these anonymous,

05:45

anonymous function expressions. Now when we are using functions as variables, they are going to follow the rules of the variable. For example, here, this is a let variable, which means that we cannot use it before it has been assigned. Another common use of a function expression is in a pattern what is known as an iffy or an immediately invoked function expression. Consider a simple function example that we want to invoke immediately. If this is the only time we invoke this function, then we might as well just use a function expression and wrap it up with parenthesis and invoke it immediately.

06:17

And now that we know what function expressions are, I think it makes obvious sense why this is called an immediately invoked function expression. Now just like we can assign a function to a variable, we can even pass it in as an argument to another function. For example here, the run twice function takes a callback function and invokes it twice. So when we call run twice, we can pass in a function that logs a message, hello world, and then a run twice will run it twice, giving us two console log messages. Now, functions that take other functions as parameters in programming language terms are called hire order functions and they show up in JavaScript all the time.

06:54

For example, there is a built-in function called set timeout, which takes a callback parameter and a duration in milliseconds after which that callback will be invoked. So this code will log a second has passed after one second, and we can make another call after two seconds and log out, two seconds have passed. Now of course, if we run this code, we see a second has passed and after two seconds, two seconds have passed beyond set timeout, we will look at lots of functions that are built into JavaScript that work on top of callbacks inspired by functional programming. Modern JSS offers a neat syntax for defining functions called arrow function

07:29

expressions Consider a simple sum variable where we want to assign it a function that takes two arguments, A and B and returns to some of those values. Now of course we can use a function expression and that works fine, but there is a newer syntax called error function expressions which allow you to shorten the amount of code that you need to write syntactically. You drop the function keyword, provide your parameters, use the equals and the greater than sign to create what is lovingly called an arrow followed by the function body. Now if your function body consists of a single return statement,

08:02

you can shorten it even further to remove the body curly braces and only used expression that you were previously using in the return statement. And if you only have a single parameter within your function, for example, at 10 only has a single X parameter, then you do not even need the parenthesis around that parameter. JSS functions offer a special parameter syntax that allows it to accept multiple past and arguments as a single array, and these are known as rest parameters. For example, consider a simple log function that logs the value of two past in parameters. Now of course this works perfectly fine when we pass in the required number of

08:39

arguments, but it doesn't work as well. If we pass in only one argument as we know we are going to get undefined and it completely ignores any additional arguments that we might pass in. For example, we are passing in 1, 2, 3, and three is completely ignored. The original console log method that we are wrapping actually works much better. It works with one argument, it works with three arguments. It works perfectly fine irrespective of how many arguments we pass in, and this is where rest parameters come in. They allow you to take a variable number of arguments and convert them into a single array parameter. So now if we call a log with one, two, three,

09:16

we get all of these three arguments converted into a single array, and as you can see, that is what gets logged out. One thing to note is that rest parameters do come in as a single array, but what about that objective of making it similar to console dot log where it would log out three different items. To do that, we would need to invoke log with multiple arguments, and we already know how to do that because we just looked at spread arguments. So we can take the single array and spread it into multiple arguments when we are calling log.

09:48

Now one more thing to be aware of with S parameters is that it must be the last perimeter within a function definition. So if we use triple dots before any other parameter, we would actually get a syntax error. Now of course, we can mix rest parameters with other parameters as long as the rest parameter is the last one. Here we have a nice prefixed log function with the first argument is a prefix that is going to be pretty printed followed by the rest parameters. A welcome modern syntax offered by JavaScript functions is the ability to define default parameters.

10:20

Consider a simple sum function that is designed to sum three numbers. Now of course, if he pass in one, two, and three, it is going to provide the sum which is six. But if you forget one of the arguments we are going to get back that thing that we looked at before called not a number. This is because we just tried to do math on an undefined. We can actually provide a default value for a parameter by adding an assignment expression after the perimeter name. So this still works if all those three parameters are provided. So 1, 2, 3, sum it up, we get six. But we can also provide only a few of the arguments.

10:54

For example, only provide one and two, and we get back the sum three because C has defaulted to zero. One thing to know about default parameters is that they basically work on top of undefined, so we can actually use them in any position. And if you want to use the default value for any of the parameters, simply pass in undefined for that particular argument. So here since we are passing undefined for B, b is going to default to zero and one plus zero plus three equals four. If you've worked with other programming languages, you might be familiar with the concept of arguments being passed by reference versus passed by value.

11:27

Let's take a look at what this means and how it applies to JavaScript. In JavaScript. Arguments are always passed by value. What this means is that assigning the perimeter to a new value does not impact the original argument. And this is true for all types. For example, here we have a primitive number, and when that gets passed in, we try to assign the parameter and new value, but the original primitive still stays at a value of three, and we can verify that the same also works If you were to accept an object, for example, Hey, we have an object with the property name of value, John,

12:01

we pass it into the function and the function tries to do a reassignment, but the original object of course remains unchanged. Some programming languages have a concept of reference parameters that allow such reassignment that is not something that is supported by JavaScript. A great mental model to have is that the conversion from argument to parameter is the same as assigning a value to a variable. Consider that object again with the property name of value. John, we can assign this object to another variable, for example, person and right now mutations to person would actually mutate the original object, but if we reassign person to a completely different object,

12:38

it's going to become completely disconnected from the original object, which of course means that the original object or name will continue to be drawn. And this assignment expression where person equal to object is exactly what happens when we pass an argument to a perimeter. This means that if we make the perimeter point to something else, then that has no impact on the original argument. Now if we take that object that person is pointing to and modify some of its properties, for example, modify the name, then of course since person is still pointing to that original object, that original object is exactly what is going to get mutated. And since argument to function parameter is nothing more than an assignment,

13:14

if we take that object and mutate it, the original reference to object is exactly what's going to get mutated. Needless to say, mutating past and values in JavaScript is normally frowned upon as these side effects can be quite hard to reason about. So let's talk a bit about pure functions. Consider a simple global variable and an increment function which modifies that global count variable. Now of course this does work. We can initialize count to zero incremented in purely and now count is incremented, but that's not going to be particularly maintainable. There is no indication reading this code that count is going to get changed.

13:50

A much better implementation is something that takes an input and returns the results. So here increments depends upon nothing other than a parameters, and it does not modify the parameter any other global variable for that matter. Now, when we use increment, we are responsible for making sure that we store the result as we see appropriate. And for anyone else that reviews our code, it'll be very clear that the count is going to get changed. Just like we can use destructuring in variable assignment, we can use destructuring in function parameters as well because after all, argument to perimeter passing is sort of like a variable assignment considering

14:26

a very simple range function that takes a value min and max and makes sure that the value does not exceed the boundaries of min and max. Now of course, this does work perfectly fine. For example, we can pass in a value of 100, a min of zero and a max of 10, and it clamps it down to the value of 10. But if someone were to review this code by itself, it would be very hard to understand which one is the value, which one is the min and which one is the max. So a better option is to actually pass in a single object with a different keys, identify the nature of the properties, and now that a single object is going to get passed in,

14:58

instead of using a single identifier, we can destructure it into its members, which of course are value min and max. From a runtime perspective, again, this is exactly like doing an assignment. So just like within an assignment, we can do destructuring, we can do destructuring from an argument to a parameter. One of the most powerful features of JavaScript functions and something that was critical for things like node jss is the JavaScript support for closures. It should come as no surprise that when we have a variable outside of the function, we can access that variable from within that function. So over here example is incrementing alpha. And of course,

15:34

once we invoke example, alpha is going to be incremented from zero to one. A closure is nothing more than the fact that a variable in an outer scope has been closed over and a bound to a function. What is interesting is that this binding continues to exist even after the outer scope has returned. So hey, we have a function called counter that has a local variable called count, and then it has an inner function that of course can exist this outer variable called count. Now, even after the counter function will return, this particular instance of the count variable will continue to be bound to this particular instance of the function that gets returned.

16:09

And we can prove this with a simple example by creating an increment function which is returned from counter. And then as we invoke it again and again, we get back constantly incrementing versions of that original count variable. We can combine JavaScript support for first class functions and its support for closures to create a very popular design pattern called factory functions. Because functions are first class within JavaScript, we can create objects that contain functions. And because JavaScript supports closures, these functions will have access to variables that only exist within the containing function.

16:44

So here our create counter function creates an object that has incremental decrement value and reset functions. And all of these functions operate on top of a local count variable. So when we create a counter, we get to provide an initial value, and of course, if we don't provide one, it defaults to zero, and then our only access to that variable is via these controlled methods that are a part of the returned object. As you can see, JavaScript functions by themselves allow people to create some pretty well structured modules even before the support for native classes was added. When we are defining functions within objects,

17:16

which in object oriented programming are called object methods, JavaScript provides an additional shorthand syntax called object method definition. As an example, consider an object cat dog that has a method called speak, which is a function that logs two simple statements. Here we are using the key value syntax of objects that we have looked at before where speak is the key and the value is a function. The object method definition, syntax gets rid of that colon, gets rid of the function keyword and provides a much tighter experience. There is no functional difference between the two.

17:48

Two, if the body of the function is a simple expression, I would use an arrow function. Otherwise I would use the object method definition. Defining functions as a part of objects also unlocks two additional types of functions, which are getters and setters, which look like functions when we define them, but behave more like standard object properties when we try to use them. Consider the example where we want to create an object that has a single property called value, but we want to make sure that whenever the value gets set, it stays within a range of a minimum and a maximum.

18:21

We can do that by providing our own custom setters and getters for the value property. Instead of defining a property like you normally would with the colon, we use a modified syntax of an object method definition where we proceed that by either the get keyword or the set keyword. Let's discuss the behavior of these, get inserters a bit more by first creating an instance of this object. We use these just like normal properties and not really methods. For example, we can read the result by simply range value. This will internally invoke that function, but for consumers, it feels like just another property.

18:54

We can also assign a new value to this property, and internally it'll invoke the function for the sitter and pass in the new value. But again, in terms of consumers, it feels like just another property. This ensures that the value can never escape the range that we originally provided, which is zero to 10. And as you can see, the updated value goes to 10 instead of going to 15. In case you were wondering, you can create recursive functions in JavaScript that is functions which in their body make a direct or an indirect call back to themselves. And a classic example of a recursive function in computer science is the

19:28

Fibonacci sequence that follows the definition. That Fibonacci of zero zero and Fibonacci of one is one. And then for all other positive intes, the Fibonacci for N is the Fibonacci of N minus one plus N minus two. So let's create a function that follows this specification. It takes an INTE N, and if it is zero, we return zero. And if it is one, we return one. Otherwise, we again invoke Fibonacci with N minus one and then add it to another invocation of Fibonacci with N minus two. So as an example for the Curious, the 11 Fibonacci number should be age nine. And of course when we run this,

20:04

that is exactly what we get. We've covered lots of features of Jka functions, and trust me when I say that as a professional developer, you will interact with functions so often that it's good to be aware of all the tools that you have available in the JavaScript tool belt. As always, thank you for joining me and I will see you in the next one.

Professional Modern JavaScript

Professional Modern JavaScript

1.Course Intro
free
⏱️ 1:13
2.Setup & Tooling
free
⏱️ 3:32
3.Debugger Statements and Breakpoints
free
⏱️ 2:17
4.Primitive Data Types and Values
free
⏱️ 3:06
5.JavaScript Variables - let and const
free
⏱️ 4:50
6.Comments in JavaScript
free
⏱️ 2:55
7.JavaScript Identifer Naming
free
⏱️ 2:52
8.Using TypeScript
free
⏱️ 4:26
9.JavaScript String Masterclass
free
⏱️ 9:29
10.JavaScript Boolean Type
⏱️ 6:45
11.Missing Guide to JavaScript Numbers
⏱️ 15:28
12.JavaScript Objects Demystified
⏱️ 13:33
13.Functions in JavaScript
⏱️ 20:25
14.JavaScript Arrays Masterclass
⏱️ 22:31
15.JavaScript If Else Statements and Best Practices
⏱️ 6:13
16.JavaScript Conditional Expressions
⏱️ 8:38
17.JavaScript Loose vs Strict Equality
⏱️ 4:02
18.Truthy vs Falsy in JavaScript
⏱️ 3:44
19.Concept of JavaScript Nullish and Unification
⏱️ 5:51
20.JavaScript Classes - Object Oriented Programming
⏱️ 10:30
21.JavaScript Error Handling and Exceptions
⏱️ 13:21
22.JavaScript Nullish Operators
⏱️ 5:48
23.JavaScript Switch Statement Masterclass
⏱️ 8:07
24.JavaScript For Loop Iteration Simplified
⏱️ 10:59
25.JSON Masterclass
⏱️ 7:59
26.JavaScript While and Do While Loops
⏱️ 2:52
27.JavaScript Date and Time Simplified
⏱️ 13:16
28.this in JavaScript
⏱️ 12:04
29.JavaScript Tagged Templates Masterclass
⏱️ 5:48
30.Promises in JavaScript
⏱️ 10:01
31.JavaScript Async Await Masterclass
⏱️ 9:00
32.JavaScript Symbols Demystified
⏱️ 7:25
33.JavaScript Iterators and Iterables
⏱️ 8:50
34.JavaScript Generators Simplified
⏱️ 9:17
35.JavaScript Prototype - The Secret Guide
⏱️ 11:21
36.JavaScript Set Builtin Data Structure
⏱️ 9:52
37.JavaScript Map Builtin - HashMap Magic
⏱️ 10:38
38.JavaScript Deferred Promise Pattern - withResolvers
⏱️ 3:35
39.Cloning and Deep Copying in JavaScript
⏱️ 3:14
40.JavaScript Async Await Sequencing and Execution Masterclass
⏱️ 10:31
41.JavaScript Memory Management Masterclass
⏱️ 5:26
42.JavaScript WeakMap Demystified
⏱️ 8:58
43.JavaScript bigint Masterclass
⏱️ 5:35
44.JavaScript WeakSet Explained with Examples
⏱️ 7:47
45.JavaScript Regular Expressions Masterclass
⏱️ 17:54
46.JavaScript Weak References Demystified
⏱️ 5:29
47.JavaScript Memory Leaks Demonstrations and Fixes
⏱️ 6:01
48.Semicolon Free Coding in JavaScript
⏱️ 3:46
49.JavaScript Modules Masterclass
⏱️ 11:36