M
M
MrJobs2020-04-26 23:38:31
JavaScript
MrJobs, 2020-04-26 23:38:31

JSON data output JS?

Tell me please.
Is it possible using JS to collect all dates from json file

[{"date":"2020\/04\/26 20:04:01","num":0.0419629726394},{"date":"2020\/04\/26 20:05:02","num":0.0420109740062},{"date":"2020\/04\/26 20:06:01","num":0.0420109740062}]


You need to get that all dates separated by commas: 2020\/04\/26 20:04:01, 2020\/04\/26 20:05:02 etc.

Answer the question

In order to leave comments, you need to log in

2 answer(s)
A
Arseny, 2020-04-26
@MrJobs

Create a new array with map.

N
no-taktik, 2020-04-27
@no-taktik

If the question is about the file, then you need to know the environment (is it a server node.js or a front-end assembly, etc.).
If the question is about parsing a JSON string, then the gentleman with the nickname Ravil suggested a solution. The only thing is that the JSON in the string must first be parsed using JSON.parse

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question