随笔分类 - ES7
摘要:We want to only freeze the private variable when we get it and set it: class Cart { #items; constructor(items = []) { this.value = items; } set value(
阅读全文
摘要:Morden Javascript allows us to write private and static class memebers. To do this, we need to install babel plugins: First, let see "static member":
阅读全文
摘要:ES2017 added two new string functions. They are padStart and padEndfunctions. In this lesson, we will understand how to use these functions and a few
阅读全文
摘要:The Object.entries() function is an addition to the ECMAscript scpec in Es2017. This allows us to iterate through the properties of an object and read
阅读全文
摘要:Somtime 'async await' can have a bad effect on code proferemence. Let's take a look the below example: In the example, we are doing two await operatio
阅读全文
摘要:This lesson shows how regular control flow statements such as try/catch blocks can be used to properly handle errors in asynchronous functions. Oftent
阅读全文
摘要:Any function can be made asynchronous, including function expressions, arrow functions, and methods. This lesson shows the syntax for each of the func
阅读全文
摘要:Original artial --> link How descorator looks like: Descorator in action: We have a class, which have an method call meow(): When Javascritp Engine re
阅读全文
摘要:ES6: If you know about the Javascirpt's event loop. You know that any asyns opreations will be throwed to the end to loop, such as 'setTimeout, http c
阅读全文