const randomBoolean = () => Math.random() >= 0.5;
randomBoolean()
const reverseStr = (str) => str.split('').reverse().join('');
reverseStr("hello")
const removeDuplicates = (arr) => [...new Set(arr)];
removeDuplicates(['foo', 'bar', 'bar', 'foo', 'bar'])
const isEven = (num) => num % 2 === 0;
isEven(5)
const timeFromDate = (date) => date.toTimeString().slice(0, 8);
timeFromDate(new Date(2021, 0, 10, 17, 30, 0))
const isAppleDevice = /Mac|iPod|iPhone|iPad/.test(navigator.platform)
isAppleDevice
const goToTop = () => window.scrollTo(0, 0);
goToTop()
const average = (...args) => args.reduce((a, b) => a + b) / args.length;
average(1,2,3)