/    Sign up×
Community /Pin to ProfileBookmark

How to break up {data: [Object{4}]}

I have a variable which contains the following:

{data: [Object{4}]}

A. How can I convert this into a string including whats in the object?

B. How could I put each variable in the object into its own variable e.g var one = Object{1}

The names of the objects are as follows:
1 – code
2 – description
3 – id
4 – status

Thanks

to post a comment
JavaScript

4 Comments(s)

Copy linkTweet thisAlerts:
@SempervivumMar 21.2020 — Converting to a string can be done easily by JSON.stringify().

Solutions for assigning members of an object to variables are given here:

https://stackoverflow.com/questions/28617513/does-javascript-have-a-language-construct-similar-to-the-php-list-command
Copy linkTweet thisAlerts:
@maxsava0201Mar 21.2020 — Is there any way to get in contact with the admin on the Discord server? There's some changes and suggestions we came up with but have no meaningful way to implement them.

Copy linkTweet thisAlerts:
@Steve_R_JonesmoderatorMar 22.2020 — If you need to get in touch with us, email us at [email protected] and we'll get back to you ASAP.
Copy linkTweet thisAlerts:
@maxsava0201Mar 22.2020 — @maxsava0201#1616508

[url=https://testmyspeed.onl/][color=#000000]Speed Test[/color][/url] [url=https://scrabblewordfinder.vip/][color=#000000]Scrabble Word Finder[/color][/url] [url=https://solitaire.onl/][color=#000000]Solitaire[/color][/url]

Is there any way to get in contact with the admin on the Discord server? There's some changes and suggestions we came up with but have no meaningful way to implement them.
×

Success!

Help @paul89 spread the word by sharing this article on Twitter...

Tweet This
Sign in
Forgot password?
Sign in with TwitchSign in with GithubCreate Account
about: ({
version: 0.1.9 BETA 4.19,
whats_new: community page,
up_next: more Davinci•003 tasks,
coming_soon: events calendar,
social: @webDeveloperHQ
});

legal: ({
terms: of use,
privacy: policy
});
changelog: (
version: 0.1.9,
notes: added community page

version: 0.1.8,
notes: added Davinci•003

version: 0.1.7,
notes: upvote answers to bounties

version: 0.1.6,
notes: article editor refresh
)...
recent_tips: (
tipper: @Yussuf4331,
tipped: article
amount: 1000 SATS,

tipper: @darkwebsites540,
tipped: article
amount: 10 SATS,

tipper: @Samric24,
tipped: article
amount: 1000 SATS,
)...