Tag : Index



How to get first element of array in Javascript?

Whenever you require to get first element value then you can use bellow example. I give you the way to get first element value in jquery. So let's see following example: <strong>Example</strong> <pre class="prettyprint lang-js"> <script type="text/javascript"> <br/> var languages = ["PHP", ".Net", "Java", "Javascript"]; <br/> var first_element = languages[0]; console.log(first_element); <br/> </script> </pre>

By Hardik Savani | April 18, 2016 | | 2591 Viewer | Category : Javascript jQuery
READ MORE

How to get last element of array in Javascript?

Whenever you require to get last element value then you can use bellow example. I give you three way to get last element value in jquery. So let's see following example: <strong>Example</strong> <pre class="prettyprint lang-js"> <script type="text/javascript"> <br/> var languages = ["PHP", ".Net", "Java", "Javascript"]; <br/> var last_element = languages[languages.length-1]; console.log(last_element); <br/> var last_element2 = languages.pop(); console.log(last_element2); <br/> var last_element3 = languages.slice(-1)[0]; console.log(last_element3);.....

By Hardik Savani | April 16, 2016 | | 2565 Viewer | Category : Javascript jQuery
READ MORE

    How to use elasticsearch from scratch in laravel 5?

    How to use elasticsearch from scratch in laravel 5?

    Open Post

    AngularJS - simple image upload with preview example in PHP

    AngularJS - simple image upload with preview example in PHP

    Open Post

    AngularJS - scroll to a specific element using anchorscroll

    AngularJS - scroll to a specific element using anchorscroll

    Open Post

    Laravel 5 - whereIn and whereNotIn with subquery example using query builder

    Laravel 5 - whereIn and whereNotIn with subquery example using query builder

    Open Post

    Automatically Refresh or Reload a Page using jQuery Example

    Automatically Refresh or Reload a Page using jQuery Example

    Open Post

    How to retrieve number of twitter followers count without authentication or api ?

    How to retrieve number of twitter followers count without authentication or api ?

    Open Post