const j = Object.prototype.valueOf.apply
console.log(typeof j); // "function"
console.log(Object.prototype.valueOf.apply === j); // true
console.log(Object.prototype.valueOf.apply(3)); // WORKS
console.log(j(3)); // ERROR! TypeError: j is not a function
I found something weird situation in JS, about Function.prototype.apply
and Function.prototype.call
function. Without storing apply
function in variable, it works. But when I store apply
function to variable, it doesn't work.
What causes this weird situation?