How to get first element of array in Javascript?

Today now in this post i would like to show you How to get first element of array in Javascript? Whenever sometimes we need to get the first element of value then we can use the bellow example. Here I will give you the way to get the first elements value in jquery.

So let’s start and see the following example:


<script type="text/javascript">
    var languages = ["PHP", ".Net", "Java", "Javascript"];
var first_element = languages[0];


Read Also : How to convert Object into Array in PHP?

Thanks for read. I hope it help you. For more you can follow us on facebook.


About Shahriar Sagor

My name is Shahriar sagor. I'm a developer. I live in Bangladesh and I love to write tutorials and tips that will help to other Developer's. I am a big fan of PHP, Javascript, JQuery, Laravel, Codeigniter, VueJS, AngularJS and Bootstrap from the early stage.

View all posts by Shahriar Sagor →