Based on Chrome
var a = ["abc", "def", "ghi"];
If you make it like this
["abc", "def", "ghi"]
You know... But this
'["abc", "def", "ghi"]'
Is there a function that makes it into a string?
javascript array string html css
Js array can be made in JSON form using stringify
.
var arr = [ "John", "Peter", "Sally", "Jane" ];
var myJSON = JSON.stringify(arr);
You can use the join function. Refer to Related lecture .
var a = ["abc", "def", "ghi"]
print(''.join(a))
I understand that if you are going to forward it to JSON.parse()
in javascript, you should write dumps.
import json
mylist = ['a', 'b', 'c']
result = json.dumps(mylist)
Please forward this result to JSON.parse().
© 2024 OneMinuteCode. All rights reserved.