Is there a dictionary implementation in JavaScript?

前端 未结 10 2058
萌比男神i
萌比男神i 2020-12-12 22:04

How can I implement an array with an indexer in JavaScript? Is there something like a dictionary in .Net?

10条回答
  •  死守一世寂寞
    2020-12-12 22:33

    The nearest implementation that I have used to a .Net dictionary in Javascript is a hash object (see link: http://www.mojavelinux.com/articles/javascript_hashes.html). It implements an array under the hood and has similarly named methods to those of a .Net dictionary.

提交回复
热议问题