Challenge: Let's Add Properties

This lesson will test your understanding of pure, impure, and arrow functions in JavaScript.

We'll cover the following...

Problem statement #

Study the code below and then run it.

Press + to interact
const func = (key, value, object) => {
object[key] = value;
};
function test() {
const car = {
name: "Toyota"
};
const answer = func("model", 88, car);
console.log({ car, answer });
}
test();

func is an impure function. The reasoning ...