Tuesday, December 9, 2014

How to delete the element in the array of json object in Java-script

Recently we had a very basic requirement to delete an key value pare in the json array using Javascript.

Input data


Expected business logic

When type of id is video and websiteUrl is null; websiteUrl should be removed from the payload.

Output data


In-order to do this you can use delete functionality of the json in javascript.

Example code