How can i copy all the attributes of a JSON object except one or two attributes?

  1. Using the Rest operator
    Example:
    var t={a:9,b:90,c:”pojd”};
    var {a,c,…re}=t;//re={b:90},a=9,c=”pojd”
  2. Using Enumerable properties
    Make the attribute as nonenumerable while declaring.
    var test = {a:4};
    Object.defineProperty(test, “nonEnum”, { enumerable: false });
    test.nonEnum=9;
    test.b=0;
    var y=JSON.stringify(test);
    var yup=JSON.parse(y);// yup={a:4,b:0}

Suffering from Knowledge Quest

Get the Medium app

A button that says 'Download on the App Store', and if clicked it will lead you to the iOS App store
A button that says 'Get it on, Google Play', and if clicked it will lead you to the Google Play store