Skip to content

Instantly share code, notes, and snippets.

View SzpakLabs's full-sized avatar
🖖

Artem Litvinko SzpakLabs

🖖
View GitHub Profile
@SzpakLabs
SzpakLabs / removeKeys.js
Created January 11, 2019 15:42 — forked from aurbano/removeKeys.js
Remove a property from a nested object, recursively
/**
* Remove all specified keys from an object, no matter how deep they are.
* The removal is done in place, so run it on a copy if you don't want to modify the original object.
* This function has no limit so circular objects will probably crash the browser
*
* @param obj The object from where you want to remove the keys
* @param keys An array of property names (strings) to remove
*/
function removeKeys(obj, keys){
var index;