Purification Exercises
Exercises on making pure versions of impure functions.
We'll cover the following...
Purify this function
Press + to interact
const assoc = (key, value, object) => {object[key] = value;};
Purify this function. It should work in just one line!
Press + to interact
const getNames = (users) => {console.log('getting names!');return users.map((user) => user.name);};
Purify this function
Press + to interact
const append = (item, list) => {list.push(item);return list;};
Purify this function
Press + to interact
const sortAscending = (numbers) => numbers.sort((a, b) => a > b);
to save progress
The Checklist
Solution Review
to save progress