dollar dayz
The "dollar" function has become famous in recent years due to its inception in many popular JavaScript frameworks. MooTools, for example, uses the dollar function to select a single element from the DOM. This functionality is extremely helpful as it allows you to keep your code extremely short and readable, not to mention document.getElementById(''); can get annoying quickly.
由于在许多流行JavaScript框架中都诞生了“美元”功能,因此近年来变得闻名。 例如,MooTools使用美元功能从DOM中选择单个元素。 此功能非常有帮助,因为它使您可以使代码极短且易于阅读,更不用说document.getElementById('');了。 会很快变得烦人。
You don't need to use a JavaScript framework to compact your code. If you frequently select unique DOM elements, you should create a dollar function for the sake of yourself and your users.
您不需要使用JavaScript框架来压缩代码。 如果您经常选择唯一的DOM元素,则应该为自己和用户创建一个Dollar函数。
翻译自: https://davidwalsh.name/javascript-dollar-function
dollar dayz