Possible Duplicate:
Remove empty elements from an array in Javascript
I want to remove null or empty elements from an array using jquery
var clientName= new Array();
clientName[0] = "jack";
clientName[1] = "";
clientName[2] = "john";
clientName[2] = "peter";
Please give some suggestions.
{}is an object definition list, not an array definition list. Which would be[].[], but the OP insists it's{}:). The example code will throw a Syntax error.