ivana_andreevska

AV7 Printing Properties

Jan 16th, 2022
160
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. var student = {
  2.     name : "David Rayy",
  3.     sclass : "VI",
  4.     rollno : 12
  5. };
  6.  
  7. Object.keys(student).forEach(prop=>console.log(prop))
  8.  
  9. for(let prop in student)
  10. {
  11.     if(student.hasOwnProperty(prop))
  12.         console.log(prop)
  13. }
Advertisement
Add Comment
Please, Sign In to add comment