Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR JAVASCRIPT

how to looping object JavaScript

// data
let errors ={
    "email":"Password is required",
    "phonenumber":"Password is required",
    "password":"Password is required"
}

//how to loop object
Object.entries(errors).forEach(error => {
  console.log(error)
})

//results
['email', 'Password is required']
['phonenumber', 'Password is required']
['password', 'Password is required']

Source by www.webmound.com #
 
PREVIOUS NEXT
Tagged: #looping #object #JavaScript
ADD COMMENT
Topic
Name
5+6 =