DEV Community

_Khojiakbar_
_Khojiakbar_

Posted on • Edited on

1

Object methods 🦜

let result;
const userProfile = {
        username: 'Khojiakbar',
        age: 26,
        job: 'programmer',
        city: 'Tashkent region',
}
Enter fullscreen mode Exit fullscreen mode

// Object.keys()
result = Object.keys(userProfile);

// Object.values()
result = Object.values(userProfile);

// Object.entries()
result = Object.entries(userProfile) // returning nested array

// Object.fromEntries()
let fromEntries = Object.fromEntries(result)

console.log(result);
console.log(fromEntries);
Enter fullscreen mode Exit fullscreen mode
// Object.freeze()
Object.freeze(userProfile);

// Add -
userProfile.weight = 80
// Modify -
userProfile.username = 'Bilol'
// Delete -
delete userProfile.city
// NO AMD
console.log(userProfile);
Enter fullscreen mode Exit fullscreen mode
// Object.isFrozen()
result = Object.isFrozen(userProfile)
console.log(result);
Enter fullscreen mode Exit fullscreen mode
// Object.seal()
result = Object.seal(userProfile);

// Add -
userProfile.weight = 80;
// Modify +
userProfile.age = 33;
// Delete -
delete userProfile.city;
// NO AD
console.log(userProfile);
Enter fullscreen mode Exit fullscreen mode
// Object.isSealed()
result = Object.isSealed(userProfile)
console.log(result);
Enter fullscreen mode Exit fullscreen mode

SurveyJS custom survey software

JavaScript UI Libraries for Surveys and Forms

SurveyJS lets you build a JSON-based form management system that integrates with any backend, giving you full control over your data and no user limits. Includes support for custom question types, skip logic, integrated CCS editor, PDF export, real-time analytics & more.

Learn more

Top comments (0)

Image of Docusign

🛠️ Bring your solution into Docusign. Reach over 1.6M customers.

Docusign is now extensible. Overcome challenges with disconnected products and inaccessible data by bringing your solutions into Docusign and publishing to 1.6M customers in the App Center.

Learn more