
Write a Javascript code,for

Hello Friend,
Try this:
<script type="text/javascript">
var lang = new Array();
lang[0] = "C";
lang[1] = "Java";
lang[2] = ".NET";
lang[3] = "PERL";
document.write(lang.join("<br>"));
document.write("<br><b>Adding element 'Python' from the Front</b><br>");
lang.unshift("Python");
document.write(lang.join("<br>"));
document.write("<br><b>Adding element 'Basic' from the Back</b><br>");
lang.push("Basic");
document.write(lang.join("<br>"));
document.write("<br><b>Removing element from the Front</b><br>");
lang.shift();
document.write(lang.join("<br>"));
document.write("<br><b>Removing element from the Back</b><br>");
lang.pop();
document.write(lang.join("<br>"));
</script>
Thanks
If you are facing any programming issue, such as compilation errors or not able to find the code you are looking for.
Ask your questions, our development team will try to give answers to your questions.