Is there a way to remove a whole property from a js object

angularjs, javascript

Solution

JavaScript has a `delete` operator:

delete $scope.obj1.number

Problem

I presume this is an odd question but I have to ask.. If I have a js object that looks like this: ``` $scope.obj1 = { "name":"John", "number":"Eleven", "color":"Red" } ``` Is there a way to remove an entire property? without re-assigning values to a new object.. So if I want to get rid of `"number":"Eleven",` I would like the object to look like this... ``` $scope.obj1 = { "name":"John", "color":"Red" } ``` Thanks!

Original source

Related problems