Skip to content

Instantly share code, notes, and snippets.

What would you like to do?
const user = {
name: 'Akash',
age: 22,
fullname: function () {
console.log("name" in user) // true
console.log("lastName" in user) // false
console.log("fullname" in user) // true
console.log("toString" in user) // true // Also show Inherited Properties
console.log(user.hasOwnProperty("toString")) // false
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.