JSFiddle - React, Tailwind, and code Playground

by rburns3

JavaScript

//code goes here
var my_array = [
	{id: 12345, first_name: 'ryan', last_name: 'burns', postcode: '2750', of_age: true},
  {id: 12346, first_name: 'marley', last_name: 'maripa-campora', postcode: '2747', of_age: true},
  {id: 12347, first_name: 'jake', last_name: 'white', postcode: '2745', of_age: true},
  {id: 12348, first_name: 'ethan', last_name: 'sorensen', postcode: '2747', of_age: true},
  {id: 12349, first_name: 'luke', last_name: 'parsnip', postcode: '2745', of_age: true},
];

//FOR LOOP
for (i=0; i < my_array.length; i++){
 console.log(my_array[i].first_name);
}

//while loop
a = 0;
while (a <my_array.length){
 console.log(my_array[a].last_name);
 a++;
}