iLTC Home
Bookmark iLTC!
iLTC Google Boards

Categories

Perl
  • Perl Tutorials Beginners

    Javascript
  • Javascript Tutorials
  • Javascript Tutorials Beginners

    HTML
  • HTML Tutorials



  • iLoveTheCode.com
    Javascript > Javascript Tutorials How To Easy > Javascript Shift Use Shift to Remove Items from the Beginning of an Array in Javascript

    Javascript Shift - Use Shift to Remove Items from the Beginning of an Array in Javascript



    i=new Array("Hi", "Hello", "Cheers", "Greetings");

    i.shift();

    document.write(i);

    Which Prints:
    Hello,Cheers,Greetings

    -We create an array and name it i because short names are more fun than long ones.
    -We use Javascript's built-in shift method to remove the first item from our array.
    -We use Javascript's built-in document.write command to print to the browser.




    Free Copy and Paste Javascript Code:

    <script type="text/javascript">
    <!--

    i=new Array("Hi", "Hello", "Cheers", "Greetings");

    i.shift();

    document.write(i);

    -->
    </script>


    Resources:
    Javascript Array - Create an Array in Javascript
    Javascript Concat - Use Concat to Join Two Arrays in Javascript
    Javascript Join - Use Join to Make an Array into a String in Javascript
    Javascript Splice - Use Splice to Replace Items in an Array in Javascript
    Javascript Reverse - Use Reverse on Items in an Array in Javascript
    Javascript Sort - Use Sort on Items in an Array in Javascript
    Javascript Shift - Use Shift to Remove Items from the Beginning of an Array in Javascript
    Javascript Pop Use Pop to Remove Items from the End of an Array in Javascript
    Javascript Unshift - Use Unshift to Put Items on the Front of an Array in Javascript
    Javascript Slice - Use Slice to Get Items from an Array in Javascript
    Splitting an Array using Javascript
    Javascript Push - Use Push on an Array in Javascript
    PRINT to Browser with document.write Command in Javascript

    Javascript Alert
    onClick Javascript
    Javascript Referrer
    Javascript Reset Form
    Annoy Users with onBlur in Javascript
    Get Query String Using Javascript
    Use innerHTML to Change Text on a Page



    Click HERE to comment or discuss at iLoveTheCode GOOGLE Group
    Previous Article: Javascript Pop Use Pop to Remove Items from the End of an Array in Javascript
    Next Article: Javascript Sort Use Sort on Items in an Array in Javascript





    JavaScriptJavaScript

    David Flanagan

    New $31.49

    HTML, XHTML, and CSS, Si...HTML, XHTML, and CSS, Sixth Edition ...

    Elizabeth Castro

    New $23.09

    Information Architecture...Information Architecture for the Wor...

    Louis Rosenfeld, P...

    New $26.39

    Struts 2 in ActionStruts 2 in Action

    Don Brown, Chad Da...

    New $29.69

    CSSCSS

    Eric Meyer

    New $29.69

    Dreamweaver CS3Dreamweaver CS3

    David McFarland

    New $29.69

    Beginning Joomla!Beginning Joomla!

    Dan Rahmel

    New $29.69

    jQuery in ActionjQuery in Action

    Bear Bibeault, Yeh...

    New $26.39


    Of Interest:
  • Exit a Loop with Last
  • Use the Perl PRINT FUNCTION
  • Add, Subtract, Multiply, and Divide in Perl
  • Create or Put Items into an Array in Perl
  • Javascript Subscript Text
  • Passing an Argument or Variable to a Javascript
  • Javascript Superscript Text
  • Opening a REMOTE WINDOW in Javascript
  • HTML Subscript Text
  • HTML Frames
  • Make Strikethrough Text Using HTML
  • HTML Color Chart

  • More Articles:
  • To Sort an Array in Perl
  • Add, Subtract, Multiply, and Divide in Perl
  • Add to End of an Array with Push in Perl
  • What Environmental Variables are Available
  • Javascript Alert
  • onClick Javascript
  • Change a Form Field with Javascript
  • Increment a Variable in Javascript
  • PRINT to Browser with document.write Command in Javascript
  • Get Formatted Time in Javascript
  • HTML Superscript Text
  • Make Strikethrough Text Using HTML
  • HTML Font Code
  • HTML Background

  • Search iLTC w/ Google





    Recent Articles

  • Javascript Focus Form Field
  • Javascript Lowercase Text
  • Javascript Uppercase Text
  • Javascript Superscript Text
  • Javascript Subscript Text
  • Make Text Blink Using Javascript
  • Make a String into a Link in Javascript
  • Javascript Italics Text
  • Javascript Bold Text
  • Javascript Redirect
  • HTML Frames
  • HTML Color Chart
  • HTML Link
  • Javascript Status Bar








  • Perl Programming - Javascript Programming - Maybe Some PHP - Free Scripts - ILoveTheCode
    All Content © 2006 iLoveTheCode.com


    Contact Chris | About this Site


    581,280
    Counter by iLoveTheCode.com


    Last Modified: Friday, 23-Jun-2006 07:23:15 EDT