How to get first element of array in Javascript?

Share Me
  •  
  •  
  •  
  •  
  •  
  •  
  •  
  •  
  •  
  •  
  •  

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:

Example

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

</script>

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 code chef

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 code chef →