Skip to content
JS Fundamentals: Objects, Arrays, and Functions
Share
Explore

Introduction

Welcome to JavaScript Fundamentals: Objects, Arrays, and Functions
These days it is not enough to be able to copy and paste code from the internet and just get it to work.
If you want to become a professional JavaScript developer, you need to understand the how and the why. This is an intermediate course that takes you from “wow it works” to “I know how it works”.

We will go over the pillars of the JavaScript language slowly and in-depth. I will provide you with opportunities to practice and will ask you a lot of questions so that you can master the fundamentals of the language and ultimately set yourself up for success as a professional JavaScript-er!

By the end of this course, you will be able to understand how these examples work and how to implement the internals yourself. Having this depth in your toolbox will help you with your day-to-day coding as well as in an interview setting.


Get clear on how objects and arrays work the way they do

const
a = {};
const
b = { key:
'b'
};
const
c = { key:
'c'
};

a[b] =
123
;
a[c] =
456
;

console.
log
(a[b]);


Master reduce and using callbacks in your code

function
partition
(
collection
,
callback
) {
const
basePartition
= (
result
,
value
) => (
result[callback(value) ?
0
:
1
].
push
(value), result
);

return
collection.
reduce
(basePartition, [[], []]);
};


Implement internals of JS methods

function
filter
(
collection
,
callback
) {
const
result = [];
forEach
(collection, (value, key) => {
if
(callback(value, key, collection)) {
result.
push
(value)
}
});
return
result;
};


Understand commons gotchas when using functions

function
callLater
(
func
) {
return
function
(
a
) {
return
function
(
b
) {
return
function
(
c
) {
return
func
(
a
,
b
,
c
);
}
}
}
};


Use closures like a pro

const
countClues
= () => {
let
n =
0
;

return
{
count
: () => ++n,
reset
: () => n =
0
};
};

const
c =
countClues
();
const
d =
countClues
();

c.
count
(), c.
count
();
d.
count
();

Don’t be fooled if you feel like you “intuitively” know what is happening in these code snippets. Spend the next few hours with me to understand the core concepts that connect these examples together so that you can be really confident that you know the how and why your code works. And more importantly, be able to figure out more quickly why something is not working 😆.

Next 👉


Want to print your doc?
This is not the way.
Try clicking the ⋯ next to your doc name or using a keyboard shortcut (
CtrlP
) instead.