How can I remove properties from JavaScript objects?

Learn how to erase JavaScript properties using the delete method, or convert the property to “undefined.”

By Craig Buckler
September 6, 2016
Screenshot from "Removing properties from JavaScript objects" Screenshot from "Removing properties from JavaScript objects"

You’ve defined a variable as the property of an object, but now you want to get rid of it. In this video Craig Buckler teaches novice JavaScript developers how to perform this essential operation, beginning with the basics of object creation. Learn how to erase your property using JavaScript’s delete command or, for more complex objects, convert the property to “undefined.” Beginners can follow along easily as Buckler demonstrates each option using jsconsole.com.

Learn faster. Dig deeper. See farther.

Join the O'Reilly online learning platform. Get a free trial today and find answers on the fly, or master something new and useful.

Learn more
Post topics: Web Programming
Post tags: Questions
Share: