Navigate back to the homepage

How to get first element of array in javascript?

Infinitbility
JavaScript
November 15th, 2021 · 1 min read
How to get first element of array in javascript?

Hello Friends 👋,

Welcome To Infinitbility! ❤️

This tutorial will help you to get the first element of the array, here we will use the basic syntax of the javascript array to get the first value.

Let start today’s tutorial How to get the first element of the array in javascript?

well, javascript stores all their elements index-based, and every time the first element assigns the 0 index.

when we pass on an array, it will return the first element like this arr[0].

Let understand with an example.

1var ary = ['first', 'second', 'third', 'fourth', 'fifth'];
2alert(ary[0]); // first

Thanks for reading…

Join our email list and get notified about new content

No worries, I respect your privacy and I will never abuse your email.

Every week, on Tuesday, you will receive a list of free tutorials I made during the week (I write one every day) and news on other training products I create.

Looking For React Native Tutorial?

we are trying to create the best Tutorial for react native developers.

When you want a daily updates about React Native Tutorial or infinitbility update subscribe to our newsletter.

Read React Native Tutorial

Request New Tutorial or Article on mail [email protected]

Guide book

Guidebook: The Javascript Monorepo

Tutorials

Categories

More articles from Infinitbility

How to add icon in bottom tab navigation react native?

How to add icon in bottom tab navigation react native?

React Navigation icon tab navigation example.

November 12th, 2021 · 1 min read
How to remove back button in react navigation?

How to remove back button in react navigation?

React Navigation remove back button from stack mavigation screen example.

November 11th, 2021 · 1 min read
© 2020–2021 Infinitbility
About
Link to $https://medium.com/infinitbilityLink to $https://www.facebook.com/InfinitbilityLink to $https://github.com/infinitbilityLink to $https://twitter.com/infinitbilityLink to $https://www.buymeacoffee.com/infinitbilityLink to $mailto:[email protected]