javascript - variable is already defined -
sometime need replace variable value another
so use method
var $$test = "first", $$test = "second";
the code work fine use jsfiddle jshint button check error on javascript (it helped me lot)
but got error '$$test' defined
so ideal method re define variable
thank :)
you're getting error because you're declaring same variable twice.
var = foo, = bar;
is same as:
var = foo; var = bar;
just break code in 2 lines, , won't warning. this:
var = foo; = bar;
also notice if declare variable value, , right after change value, first line noop.
Comments
Post a Comment