-4

I've got an JSON object like that:

var storeOriginalList = '[{"Store_Id" : "1932","Store_Name" : "1 Sale A Day12","KeywordURL" : "1-Sale-A-Day1234","Category" : "Stores"},{"Store_Id" : "1171","Store_Name" : "100 Day Loans","KeywordURL" : "100-Day-Loans","Category" : "Stores"}]'

I want to extract only Store_Id, Store_Name and also make an another new JSON object.

My question is, can I do it without looping. If yes, then please provide a sample code.

trejder
  • 17,148
  • 27
  • 124
  • 216
Navin 431
  • 49
  • 1
  • 9

1 Answers1

1

You can't reasonably do it without looping, no. You could try with a regular expression, but A) That would be looping, too, in the processing of the regex; and B) Using regular expressions to manipulate non-regular things like JSON or HTML is prone to failure.

Here are tools you could use in your solution:

Community
  • 1
  • 1
T.J. Crowder
  • 1,031,962
  • 187
  • 1,923
  • 1,875