How to delete empty array values with .grep?
I'm trying to check an array for empty values, and delete them from the array so that I only keep the important array values. Can someone tell me why this would not work?
$(document).ready(function(){
var siteurl = window.location.protocol + "//" + window.location.host
$("a").click(function stripLink(){
var permalink = $(this).attr("href").replace( siteurl, "" );
permalink_array = permalink.split(/[&\/\\#,+()$~%.'":*?<>{}]/g);
//Function that is supposed to strip the empty values but I don't see it working yet.
$.grep ( permalink_array, function(n,i){
return (n != '' || n != null || n != NaN);
});
});
});