Purification Exercises
Exercises on making pure versions of impure functions.
Purify this function
const assoc = (key, value, object) => {object[key] = value;};
Purify this function. It should work in just one line!
const getNames = (users) => {console.log('getting names!');return users.map((user) => user.name);};
Purify this function
const append = (item, list) => {list.push(item);return list;};
Purify this function
const sortAscending = (numbers) => numbers.sort((a, b) => a > b);