1.

Why do we fill columns with JavaScript?

Answer»

You can fill static VALUES in an array using the fill() method in JavaScript. An example is here:

<!DOCTYPE html> <html> <body> <script> var ARR = ["ABC", "def", "ghi", "jkl"]; document.write("INITIAL array = "+arr); document.write("<br>UPDATED array = "+arr.fill("pqr",1,2)); </script> </body> </html>

The output displays that the array is set with static value: 

Initial array = abc,def,ghi,jkl Updated array = abc,pqr,ghi,jkl


Discussion

No Comment Found