G
Gregor Kofler
Nick S meinte:
What do you mean by "json object"?
You are looking for "for ... in". Mind the possible problems with
(augmented) prototypes, though.
Gregor
Hi
Is there anyway to iterate through a json object and retrieve the name
of the property as well as the value.
What do you mean by "json object"?
For exampe. Imagine this object
{
title: '1',
bedrooms: '2',
bathrooms: '3',
description: '4',
country: '5',
location: '6',
price: '7',
}
I want to loop through it and have a variable that holds title, then
bedrooms then bathrooms.... as well as one that holds 1 then 2 then
3... respectively.
Is that possible?
You are looking for "for ... in". Mind the possible problems with
(augmented) prototypes, though.
Gregor