---
title: "Extracting data from JSON in javascript"  
description: "Extracting data from JSON in javascript"  
author: "Anonymous User"  
published: 2013-06-20  
updated: 2013-06-20  
canonical: https://www.mindstick.com/forum/1249/extracting-data-from-json-in-javascript  
category: "json"  
tags: ["json"]  
reading_time: 1 minute  

---

# Extracting data from JSON in javascript

Hi [Developers](https://www.mindstick.com/articles/12875/blunders-you-must-avoid-while-hiring-java-developers-to-get-the-best-fulfilling-your-needs),\
\
This is my [JSON](https://www.mindstick.com/forum/34446/convert-json-string-to-object) that I get back (this is what it is after I stringify it):\
\
{"1":"[Water](https://yourviews.mindstick.com/story/1535/countries-with-the-worst-drinking-water) Accumulation","2":"Water [Preservation](https://www.mindstick.com/articles/43800/quick-tips-for-hair-preservation)","3":"[Release](https://www.mindstick.com/news/2247/apple-plans-to-release-new-macs-in-early-2023) [Target](https://yourviews.mindstick.com/view/81207/small-industries-should-be-the-target-of-economic-relief-package) [Date](https://yourviews.mindstick.com/story/3869/propose-day-2024-exciting-date-ideas-for-you-and-your-partner)"}\
How can I [extract](https://www.mindstick.com/forum/12883/how-to-extract-sub-string-between-two-string-pattern-using-javascript-jquery) this [data](https://www.mindstick.com/articles/13050/salesforce-aiming-to-dominate-predictive-analytics-with-data-science) in javascript. I have tried eval, JSON.parse both do not work.\
\
Thanks in [advance](https://www.mindstick.com/blog/33258/jee-mains-and-jee-advance-exams) for any recommendations or solutions.

## Replies

### Reply by AVADHESH PATEL

Hi,\
I couldn't find any problem, but you can try as following\
var a = '{"1":"Water Accumulation","2":"Water Preservation","3":"Release Target Date"}';\
var b = JSON.parse(a);\
console.log(b);console.log(b[1]);console.log(b[2]);console.log(b[3]);Or you can just do\
var b = {"1":"Water Accumulation","2":"Water Preservation","3":"Release Target Date"};\
console.log(b[1]); console.log(b[2]); console.log(b[3]);


---

Original Source: https://www.mindstick.com/forum/1249/extracting-data-from-json-in-javascript

Copyright © MindStick Software Pvt. Ltd. This Markdown version is provided for developers, AI systems, and offline reading.
