- Data Structure
- Networking
- RDBMS
- Operating System
- Java
- MS Excel
- iOS
- HTML
- CSS
- Android
- Python
- C Programming
- C++
- C#
- MongoDB
- MySQL
- Javascript
- PHP
- Physics
- Chemistry
- Biology
- Mathematics
- English
- Economics
- Psychology
- Social Studies
- Fashion Studies
- Legal Studies
- Selected Reading
- UPSC IAS Exams Notes
- Developer's Best Practices
- Questions and Answers
- Effective Resume Writing
- HR Interview Questions
- Computer Glossary
- Who is Who
How to create a zero-filled JavaScript array?
To create a zero-filled JavaScript array, use the Unit8Array typed array.
Example
You can try to run the following code:
<html> <body> <script> var arr1 = ["marketing", "technical", "finance", "sales"]; var arr2 = new Uint8Array(4); document.write(arr1); document.write("<br>Zero filled array: "+arr2); </script> </body> </html
Output
marketing,technical,finance,sales Zero filled array: 0,0,0,0
Advertisements
To Continue Learning Please Login
Login with Google