Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR JAVASCRIPT

js rename property

function renameProperty(obj, oldName, newName) {
  obj[newName] = obj[oldName];
  delete obj[oldName];
}
 
PREVIOUS NEXT
Tagged: #js #rename #property
ADD COMMENT
Topic
Name
8+6 =