function ReverseStr(str = ''){
return str.split('').reduceRight((t, v) => t + v)
}
const str = 'margo';
console.log(ReverseStr(str))
function Fibonacci(len = 2){
const arr = [... new Array(len)];
return arr.reduce((t, v, i) => (i > 1 && t.push(t[i-1] + t[i-2]), t), [0,1])
}
console.log(Fibonacci(10))
function GetKeys(obj = {}, keys = []){
return Object.keys(obj).reduce((t, v) => (keys.includes(v) && (t[v] = obj[v]), t), {})
}
const target = {a: 1, b: 2, c: 3, d: 4};
const keyword = ['a', 'd'];
console.log(GetKeys(target, keyword));
console