数据结构 - 字典 2020-07-24- 2022-01-05 数据结构与算法-数据结构字典12345678910111213141516171819202122232425262728class Dictionary { constructor() { this.store = new Object(); } add(key, val) { this.store[key] = val; } del(key) { delete this.store[key]; } find(key) { return this.store[key]; } has(key) { return this.store[key] === undefined ? false : true; } size() { return Object.keys(this.store).length; } toString() { const keys = Object.keys(this.store); keys.forEach((key) => { console.log(`key:${key}:${this.store[key]}`); }); }}module.exports = Dictionary; I'm so cute. Please give me money.Post author: 彩鹏Post link: https://blog.gaocaipeng.com/2020/07/24/nvhiep/Copyright Notice: All articles in this blog are licensed under unless otherwise stated.