Ask Your Question
3

How can you remove an object in Nodejs?

asked 2023-07-19 17:30:11 +0000

bukephalos gravatar image

edit retag flag offensive close merge delete

1 Answer

Sort by ยป oldest newest most voted
0

answered 2023-07-19 17:37:02 +0000

nofretete gravatar image

To remove an object in Node.js, you can use the delete keyword followed by the object property you want to remove. Here is an example:

const myObject = { name: 'John', age: 30 };

// Remove the 'age' property from the object
delete myObject.age;

console.log(myObject); // Output: { name: 'John' }

This will remove the age property from the myObject object.

edit flag offensive delete link more

Your Answer

Please start posting anonymously - your entry will be published after you log in or create a new account. This space is reserved only for answers. If you would like to engage in a discussion, please instead post a comment under the question or an answer that you would like to discuss

Add Answer


Question Tools

Stats

Asked: 2023-07-19 17:30:11 +0000

Seen: 11 times

Last updated: Jul 19 '23