69

[js]一道缓存类面试题

 6 years ago
source link: https://juejin.im/post/5aa0037b6fb9a028c42dc260
Go to the source link to view the article. You can view the picture content, updated content and better typesetting reading experience. If the link is broken, please click the button below to view the snapshot at that time.
在开发过程中踩了一个坑,觉得挺有意思,就顺手编成了一道题。 // Cache是一个缓存类,使用时先在new方法中注册获取数据的方法,然后可通过get方法获取数据, // 并且只有第一次调用get会真正调用new中注册的方法获取数据,以后都直接从缓存中返回。

About Joyk


Aggregate valuable and interesting links.
Joyk means Joy of geeK