I'm creating a simple webapp. The backend of this app is build in Flask. I have to pass an array from flask to javascript, to put all the datas into a chart. THe problem is that, when I pass the following array:
[70,50]
Javascript obtain that:
['70', '50']
Here is the code (flask):
@view.route("/journey", methods=["GET", "POST"])
@login_required
def journey():
#code to elaborate arr
return render_template("journey.html", user = current_user, data = arr)
Javascript(this is write in a html file, in a script tag):
let data = ('{{ data }}');
I don't know if i'm messing something, or if it is normal. I can see that the number into the array, but I don't know if I must extract it manually, or if there is a better way to obtain the result. Thanks