javascript - How to evaluate var Array in nodejs, at client side? -
the statement
- var x = [ "a", "b", "c"]
when evaluated using #{x}
converts x
string "a, b, c".
how evaluate x without converting string?
note: i'm using bootstrap plug in demands array input.
<input data-source='["a", "b", "c"]' >
here trying substitute above array x
. mentioned above, #{x}
operation converts sting, rather deliver array data-source
.
use json.stringify()
convert array json/string representation:
var x = json.stringify( [ "a", "b", "c"] ); // yields '["a", "b", "c"]'
Comments
Post a Comment