Krisalay Krisalay - 1 year ago 91
Javascript Question

Get the values from JSON document

I have the following JSON document,

var data = [
{"id":1, "username":"user1"},
{"id":2, "username":"user2"},
{"id":3, "username":"user3"}

How to get all the values with the key "username", without using any loop?

Answer Source

You can make this in ES6/5 => {
  return element.username;

Documentation here

Or without loop

Recommended from our users: Dynamic Network Monitoring from WhatsUp Gold from IPSwitch. Free Download