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 2 of 2

Thread: hasmap or map?

  1. #1
    New Coder
    Join Date
    Jul 2005
    Posts
    33
    Thanks
    0
    Thanked 0 Times in 0 Posts

    hasmap or map?

    is there hashmap or map in javascript?

    i want to map my data using string

    instead of 0 to whatever number

  • #2
    Supreme Master coder! glenngv's Avatar
    Join Date
    Jun 2002
    Location
    Philippines
    Posts
    11,042
    Thanks
    0
    Thanked 251 Times in 247 Posts
    Code:
    var hash = [];
    hash["greet"] = "Hello world!";
    hash["now"] = new Date();
    hash["alertFunc"] = function(msg){
      alert(msg);
    }
    
    var msg = hash["greet"] + " Today is " + hash["now"] + ".";
    hash["alertFunc"](msg);


  •  

    Posting Permissions

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