Languages
[Edit]
EN

JavaScript - how to remove property from object?

10 points
Created by:
Marcin
17410

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
­čÜÇ
Get your tech brand or product in front of software developers.
For more information Contact us
Dirask - we help you to
solve coding problems.
Ask question.

ÔŁĄ´ŞĆ­čĺ╗ ­čÖé

Join