Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- var myObj = {
- "number": 10,
- "general": "general",
- "array": [{
- "num1": 11,
- "text": "text1",
- }, {
- "num2": 1,
- "text": "text2",
- }, {
- "num3": 3,
- "text": "text3",
- } ]
- };
- for (i=0; i <myObj.array.length; i++) {
- a = myObj.array[i].text
- a1 += a
- }
- var myObj = {
- "number": 10,
- "general": "general",
- "array": [{
- "num1": 11,
- "text": "text1",
- }, {
- "num2": 1,
- "text": "text2",
- }, {
- "num3": 3,
- "text": "text3",
- }, ]
- };
- var a1 = [];
- for (i=0; i <myObj.array.length; i++) {
- a1.push(myObj.array[i].text);
- }
- a1.join(',')
- myObj.array.map(function (item) {
- return item.text;
- });
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement