Hello and welcome to our community! Is this your first visit?
Register
Enjoy an ad free experience by logging in. Not a member yet? Register.
Results 1 to 6 of 6
  1. #1
    New to the CF scene
    Join Date
    Dec 2012
    Location
    Moscow
    Posts
    3
    Thanks
    1
    Thanked 0 Times in 0 Posts

    Javascript Stacks

    Javascript LIFO
    Last edited by Alona; 01-09-2013 at 12:00 PM.

  • #2
    Senior Coder xelawho's Avatar
    Join Date
    Nov 2010
    Posts
    3,170
    Thanks
    56
    Thanked 588 Times in 584 Posts
    what have you done so far?

  • #3
    Regular Coder
    Join Date
    Jan 2013
    Location
    Sunnyvale, CA
    Posts
    202
    Thanks
    11
    Thanked 10 Times in 10 Posts
    create two array objects, and use their push() and pop() functions to do precisely that!

    e.g.:
    pressing ENTER: array2.push( <text value> );
    pressing FORWARD: array3.push( array2.pop() );
    pressing BACK: array2.push( array3.pop() );

    search for JavaScript Array object members for additional functions.

  • #4
    New to the CF scene
    Join Date
    Dec 2012
    Location
    Moscow
    Posts
    3
    Thanks
    1
    Thanked 0 Times in 0 Posts
    Thanks a lot.
    Last edited by Alona; 01-09-2013 at 11:54 AM.

  • #5
    New to the CF scene
    Join Date
    Dec 2012
    Location
    Moscow
    Posts
    3
    Thanks
    1
    Thanked 0 Times in 0 Posts
    Thanks.
    Last edited by Alona; 01-10-2013 at 10:23 AM.

  • #6
    Regular Coder
    Join Date
    Jan 2013
    Location
    Sunnyvale, CA
    Posts
    202
    Thanks
    11
    Thanked 10 Times in 10 Posts
    the least you can do is rewrite it with different variable names, you might even learn something through the experience...


  •  

    Posting Permissions

    • You may not post new threads
    • You may not post replies
    • You may not post attachments
    • You may not edit your posts
    •