- <!DOCTYPE html>
- <html>
- <head>
- <meta name="viewport" content="width=device-width, initial-scale=1">
- <script>
- var _arr = [];
- function create_array()
- {
- _arr = [];
- for (i = 0; i < 5; i++)
- {
- _arr.push(i);
- }
- alert("Array Created");
- }
- function view_array()
- {
- alert(_arr);
- }
- </script>
- </head>
- <body>
- <input value="Create Array" type="button" onclick="create_array();">
- <input value="View Array" type="button" onclick="view_array();">
- </body>
- </html>
Dynamic array :- JavaScript
Reviewed by Network security
on
November 13, 2019
Rating:
No comments: