Setting & Deleting Properties
This lesson teaches how to set properties using dot operator or square brackets and how to delete properties.
Press + to interact
Javascript (babel-node)
//creating an object named employeevar employee = {//defining properties of the object//setting data valuesname : 'Joe',age : 20}console.log("Originally age was:",employee.age)//updating the value of "age"employee.age = 24console.log("New age is:",employee.age)
...
Create a free account to access the full course.
By signing up, you agree to Educative's Terms of Service and Privacy Policy