object methods in javascript

JavaScript
Object.getOwnPropertyNames() let object = {
  'key1': 'value1',
  'key2': 'value2',
  'keyn': 'valuen',
};
console.log(object);const object = {
  something: "something";
}JavaScript methods are actions that can be performed on syntax.
Examples of methods include syntax ending with ();
                                                
Examples:
console.log();                                                
toUpperCase();
Math.floor();

They help change original syntax in various ways./// OBJECTS IN JAVASCRIPT
const testScore = {
  damon: 89,
  shawn: 91,
  keenan: 80,
  kim: 89,
};

Object.keys(testScore);  // gives all keys
Object.values(testScore); // gives all values
Object.entries(testScore); // gives nested arrays of key-value pairs

// YOU CAN USE ( FOR-IN )  LOOP FOR ITERATION OVER OBJECTS
for (let person in testScore) {...} 

// WE CAN'T DIRECTLY USE ( FOR-OF ) LOOP IN OBJECTS BUT WE CAN DO Like THIS:
for(let score of Object.values(testScore)){
  	console.log(score)  // 89 91 80 89 
}

let names = {
	name1: 'What ever you want to put'
}
Source

Also in JavaScript: