javascript - Google Chrome Console Copying Variables -


i came across interesting behavior in google chrome's console when "copying" variable.

try following on "fresh" chrome console one line @ time:

var = "string";

var copy = a;

copy.length; //returns uncaught typeerror: cannot read property 'length' of undefined

it turns out "copy" function baked in chrome: https://developer.chrome.com/devtools/docs/commandline-api#copyobject

copy happens unlucky choice variable name in console but, curiously, if reassign twice work (try following on new "fresh" console):

var = "string";

var copy = a;

var copy = a; //declare twice

copy.length; //6

is there reason why works way in console? on 64-bit 43.0.2357.130


Comments

Popular posts from this blog

toolbar - How to add link to user registration inside toobar in admin joomla 3 custom component -

linux - disk space limitation when creating war file -

How to provide Authorization & Authentication using Asp.net, C#? -