Remove null values from javascript array -


मेरे पास एक जावास्क्रिप्ट सरणी है।

  पते = नया सरणी (document.client Cli_Build.value, document.client.cli_Address.value, document.client.cli_City.value, document.client.cli_State.value, document.client.cli_Postcode.value, document.client.cli_Country.value); Document.client.cli_PostalAddress.value = addresses.join (",");  

मुझे इन सभी सरणी मानों की सामग्री को डाक पता टेक्स्टरेआ में कॉपी करना होगा। जब मैं उपर्युक्त समारोह का उपयोग करता हूं, तो शून्य को शून्य मानों के लिए जोड़ दिया गया है। इस अतिरिक्त अल्पविराम को कैसे हटाएं?

धन्यवाद

आप फ़िल्टर करने के लिए उपयोग कर सकते हैं नल मान:

  addresses.filter (फ़ंक्शन (वैल) {वापसी वैल! == नल;})। शामिल हों (",")  

Comments

Popular posts from this blog

oracle - The fastest way to check if some records in a database table? -

php - multilevel menu with multilevel array -

jQuery UI: Datepicker month format -