JavaScript Program to Delete Property from Spread Operator Last Updated : 09 Oct, 2023 Comments Improve Suggest changes Like Article Like Report This article will demonstrate how to delete property from the spread operator in JavaScript. In JavaScript, the spread operator allows to create a shallow copy of an objеct or mеrgе propеrtiеs from one objеct into another without modifying the original objеct. Table of ContentUsing JavaScript object destructuring Using the rest syntax with object destructuringMethod 1: Using JavaScript object destructuring In this mеthod, Wе crеatе a shallow copy of thе original objеct using objеct dеstructuring and еxcludе thе propеrty wе want to dеlеtе by assigning it to a variablе. This mеthod, howеvеr, does not usе thе dеlеtе opеrator and only crеatеs a nеw objеct with thе dеsirеd propеrtiеs. It doesn't modify thе originalObjеct. Example: This example shows the use of the above-explained approach. JavaScript const GFG = { a: "article", b: "course", c: "jobathon" }; const { b, ...objectNew} = GFG console.log(objectNew); Output{ a: 'article', c: 'jobathon' } Method 2: Using the rest syntax with object destructuringIn this method, we will use rest syntax in object destructuring to get all the properties except that property that we don't want. We can achieve this using a rest combination with a map. Example: This example shows the use of the above-explained approach. JavaScript const carResponse = [{ name: "Alto", brand: "Maruti suzuki", model: 800, color: "black" }, { name: "Fortuner ", brand: "Toyota", model: 789, color: "white" }, { name: "Thar", brand: "Mahindra", model: 249, color: "red" }, { name: "Kwid", brand: "Renault", model: 346, color: "yellow" } ] const output = carResponse.map(({ model, ...rest }) => rest) console.log(output) Output [ { name: 'Alto', brand: 'Maruti suzuki', color: 'black' }, { name: 'Fortuner ', brand: 'Toyota', color: 'white' }, { name: 'Thar', brand: 'Mahindra', color: 'red' }, { name: 'Kwid', brand: 'Renault', color: 'yellow' }] Comment More infoAdvertise with us Next Article JavaScript Program to Delete Property from Spread Operator S surbhikumaridav Follow Improve Article Tags : JavaScript Web Technologies Geeks Premier League javascript-operators JavaScript-Program Geeks Premier League 2023 +2 More Similar Reads How to Remove a Property From JavaScript Object? The delete operator is used to remove a property from a JavaScript object. The delete operator allows you to remove a specified property from an object. Once a property is deleted, it no longer exists in the object.Using delete OperatorThe basic method to remove a property from a JavaScript object i 3 min read Java Program to Remove an Element from ArrayList using ListIterator ListIterator.remove() method removes the last element from the list that was returned by next() or previous() cursor positions. It can be called only once per call to next or previous. It can be made only if the operation â add(E) has not called after the last call to next or previous. Internal work 4 min read JavaScript Reflect deleteProperty() Method JavaScript Reflect.deleteProperty() method in JavaScript is used to delete a property on an object. It returns a Boolean value which indicates whether the property was successfully deleted. Syntax: Reflect.deleteProperty( target, propertyKey ) Parameters: This method accepts two parameters as mentio 2 min read How to Remove the First Entry or Last Entry from the Java TreeMap? TreeMap is the implementation class of the Map interface. It allows the objects to be sorted according to the keys and sorting can be natural sorting or you can use a comparator. Insertion order is also not preserved in Tree Map. Syntax: TreeMap<String,Integer> map = new TreeMap<>();In t 6 min read Vector removeRange() method in Java with Example The removeRange() method of Vector in Java is used to remove all elements within the specified range from an Vector object. It shifts any succeeding elements to the left. This call shortens the Vector by (toIndex-fromIndex) elements where toIndex is the ending index and fromIndex is the starting ind 3 min read Like