JSFiddle - React, Tailwind, and code Playground

by Huy Le

JavaScript

console.clear();

var a = {
	PropA: 'Property 1',
  PropB: 'Property 2',
  PropC: 'Property 3'
};

function createObject(dropThisProperty, targetObject) {
	var {[dropThisProperty]: removeThis, ...newObject} = targetObject;

  return newObject;
}

console.log(createObject("PropB", a));