Hi,
I m having a scenario, where I need to use a variable which is having -"hiphen in its name.
When I am declaring the variable in the js. It is giving me "red cross symbol" at the line number saying
"missing ; before statement"
-----js code ----
var my-Var;
-----js code ----
Could some help me the work around here?
Thank you.
In general JavaScript, variable/function names can't contain -
. They can only contain letters, $, and _ (Underscore)
In JS dash/hypen is read as the subtract operator. So it gives an error.
User | Count |
---|---|
1 | |
1 | |
1 | |
1 | |
1 |