So everytime I try to use typeof, like on the example below
window.clone = function clone(obj){
if(obj === null || (typeof obj) !== 'object')
return obj;
var temp = new obj.constructor();
for(var key in obj)
temp[key] = clone(obj[key]);
return temp;
};
It throws me this error
Cannot find module '@babel/runtime/helpers/typeof'
That's pretty ridiculous. What can I do in this situation? Thanks in advance.
npm install --save-dev @babel/runtime
worked for me :)
Sources: