Write a JavaScript program using Array Operations?

Program: < html > < head > < title >Array operations< /title > < /head > < body > < scr...

Program:
< html >
< head >
< title >Array operations< /title >
< /head >
< body >
< script language="javascript" >
    document.writeln("< h1 >Array functions< /h1 >");
    var first=["Monday",  "Tuesday", 34, 76.34, "Wensday"];
     document.write("< p >");
     document.write(first.join(", "));
     document.write("< br >");
      first.pop();
      document.write(first.join(", "));
      document.write(" < br >");
          first.push("one", "two", "three", 76.9);
      document.write(first.join(", "));
       document.write("< br >");
       first.reverse();
        document.write(first.join(", "));
         document.write("< br >");
       first.shift();
        first.shift();
       document.write(first.join(", "));
   document.close();
< /script>
< /body>
< /html>

Out Put:

array operations




Related

Web Technology 7381627705502627323

Post a Comment

emo-but-icon

item