Apply, call, bind, декоратор
Call:
1func.call(context, arg1, arg2, ...)
Apply:
1func.apply(context, [arg1, arg2, ...])
Bind:
123let fn = func.bind(context, arg1, arg2, ...)fn()
Декоратор:
12345678910111213141516171819let fn = (x) => {return x}const decorator = (fn) => {const cache = new Map()return (x) => {if(map.has(x)){return map.get(x)}const res = fn(x)map.set(x, res)return res}}fn = decorator(fn)