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

406
Views
how to retrive data from JSON in javascript @
let data = {
  
  "@type": "Movie",
  "url": "/title/tt0443272/",
  "name": "Lincoln",
  "image": "https://m.media-amazon.com/images/M/MV5BMTQzNzczMDUyNV5BMl5BanBnXkFtZTcwNjM2ODEzOA@@._V1_.jpg",
  "description": "As the American Civil War continues to rage, America's president struggles with continuing carnage on the battlefield as he fights with many inside his own cabinet on the decision to emancipate the slaves.",
   
 
 
  
  "duration": "PT2H30M"
}


console.log(data.@type)

i have large json data from scrping but i don't know how to get value of data whose key is starting from "@"

how can i get value of @type

when i am use this method i got error :-

SyntaxError: Invalid or unexpected token

about 4 years ago · Juan Pablo Isaza
3 answers
Answer question

0

Just do console.log(data['@type'])

let data = {
  "@type": "Movie",
  "url": "/title/tt0443272/",
  "name": "Lincoln",
  "image": "https://m.media-amazon.com/images/M/MV5BMTQzNzczMDUyNV5BMl5BanBnXkFtZTcwNjM2ODEzOA@@._V1_.jpg",
  "description": "As the American Civil War continues to rage, America's president struggles with continuing carnage on the battlefield as he fights with many inside his own cabinet on the decision to emancipate the slaves.",
  "duration": "PT2H30M"
}


console.log(data['@type'])

about 4 years ago · Juan Pablo Isaza Report

0

You can access variable properties using the Bracket notation as well, like if its a key -> value:

let data = {

    "@type": "Movie",
    "url": "/title/tt0443272/",
    "name": "Lincoln",
    "image": "https://m.media-amazon.com/images/M/MV5BMTQzNzczMDUyNV5BMl5BanBnXkFtZTcwNjM2ODEzOA@@._V1_.jpg",
    "description": "As the American Civil War continues to rage, America's president struggles with continuing carnage on the battlefield as he fights with many inside his own cabinet on the decision to emancipate the slaves.",

    "duration": "PT2H30M"
}


console.log(data["@type"])

about 4 years ago · Juan Pablo Isaza Report

0

Variables in JavaScript can only start either a letter, dollar sign, or underscore.

When using an invalid variable name you cannot use dot notation and must use bracket notation

Invalid

data.@type

Correct

data['@type']
about 4 years ago · Juan Pablo Isaza Report
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!