Business
Jobs
  • About Us
  • Solutions
    • Job Postings
      Post your job and receive qualified candidates in 48h.
    • Candidate Assessments
      500+ technical and psychological tests, plus anti-fraud.
    • Headhunting
      Tailor-made executive search from start to finish.
    • Payroll + EOR
      Payroll dispersal and EOR across 15+ LATAM countries.
  • Pricing
  • Jobs

0

250
Views
Passing data from flask to Javascript, the format

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

about 4 years ago · Juan Pablo Isaza
Answer question
Find remote jobs

Discover the new way to find a job!

Top jobs
Top job categories
Business
Post vacancy Pricing Sales
Legal
Terms and conditions Privacy policy
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Show me some job opportunities
There's an error!