Remove item from JSON, and reset index from json object - Javascript JSon

Javascript examples for JSon:JSon String

Description

Remove item from JSON, and reset index from json object

Demo Code

ResultView the demo in separate window

<html>
   <head> 
      <meta name="viewport" content="width=device-width, initial-scale=1"> 
      <script type="text/javascript">
    window.onload=function(){/*from  www .j a v a2  s.c  om*/
obj = [
    {
        test: "test",
        test: "test"
    },
    {
        test1: "test1",
        test1: "test1"
    },
    {
        test2: "test2",
        test2: "test2"
    }
]
obj.splice(1, 1)
console.log(obj);
    }

      </script> 
   </head> 
   <body>  
   </body>
</html>

Related Tutorials