Create a function createUserObject that returns an object with properties name and age.
createUserObject
10 months agoCreate a function createUserObject that returns an object with properties name and age.
factoryFunction
10 months agoCreate a factory function createPerson that takes name and age, and returns an object with those properties.
constructorFunction
10 months agoCreate a constructor function Person with name and age properties. Create a new person and log it.
addProperty
10 months agoCreate an object and then dynamically add a property called 'country' to it and log the object.
checkConstructor
10 months agoCreate a function checkConstructor that logs the constructor of an object created with {}.
functionIsObject
10 months agoCreate a function myFunc and log its typeof and check if it has a name property.
valueVsReference
10 months agoCreate two object variables pointing to the same object. Modify one and log both.
enumerateProperties
10 months agoCreate an object and use for...in to log all its property names.
cloneObject
10 months agoCreate an object and make a shallow clone using spread operator, then log the clone.
destructObject
10 months agoCreate an object with name and age, destructure it, and log both values.
mathObject
10 months agoCreate a function that logs Math.PI and the rounded value of 4.7.
stringMethods
10 months agoCreate a function that uses .toUpperCase() and .includes() on a string and logs the results.
dateObject
10 months agoCreate a function that logs the current year using the Date object.