Languages
[Edit]
EN

JavaScript - how to remove property from object?

10 points
Created by:
Marcin
15740

In JavaScript it is possible to remove property rom object in following way.

1. delete operator example

// ONLINE-RUNNER:browser;

var student = {
	name: 'John',
  	age: 25
};

console.log(JSON.stringify(student));

delete student.age; //delete student['age'];

console.log(JSON.stringify(student));

 

Native Advertising
50 000 ad impressions - 449$
🚀
Get your tech brand or product in front of software developers.
For more information contact us:
Red dot
Dirask - friendly IT community for everyone.

❤️💻 🙂

Join