随笔分类 - Javascript
摘要:1. Use a for loop to traverse the videos and bookmarks array at the same time. For each video and bookmark pair, create a {videoId, bookmarkId} pair a
阅读全文
摘要:Three ways to make object immutable: 1. Use JSON.parse(JSON.stringify(obj)): this approach is little bit expense. 2. Use Object.create() This is a che
阅读全文
摘要:concatAll: Exercise 12: Retrieve id, title, and a 150x200 box art url for every video You've managed to flatten a tree that's two levels deep, let's t
阅读全文
摘要:fetch() does the same thing as XHR, but fetch return a promise. Check the reponse API here: Link Besides text(), you can use json() or blob(). 'no-cor
阅读全文
摘要:You can fine tune several webpack plugins to make your bundle as small as it can be for your specific application. However there are a few things you
阅读全文
摘要:When you have a dependency that does not export itself properly, you can use the exports-loader to force it to export the pieces of the file that you
阅读全文
摘要:If you have a multi-page application (as opposed to a single page app), you’re likely sharing modules between these pages. By chunking these common mo
阅读全文
摘要:Often, you have dependencies which you rarely change. In these cases, you can leverage the CommonsChunkPlugin to automatically put these modules in a
阅读全文
摘要:Leveraging the browser cache is an important part of page load performance. A great way to utilize this cache is by versioning your resources. In this
阅读全文
摘要:As a Single Page Application grows in size, the size of the payload can become a real problem for performance. In this lesson, learn how to leverage c
阅读全文
摘要:If you're going to use code splitting with Webpack 2, you'll need to make sure the browser has support for the ES6 Promise API. This means that if you
阅读全文
摘要:The less code you can send to the browser, the better. The concept of tree shaking basically says that if you’re not using some piece of code, then ex
阅读全文
摘要:It’s quite common to make a mistake while developing your webpack configuration. A simple typo can cost you hours of development time. With webpack-va
阅读全文
摘要:There are several lessons that will build on top of this project. It is a fairly standard, small webpack bundled project. In this lesson we’ll explore
阅读全文
摘要:slice filter map ...spread concat Object.assign
阅读全文
摘要:delete keyword doesn't actually delete the value but just the reference. So here, what actually delete is the point of me.name: So the point from 'anm
阅读全文
摘要:First, what is 'High Order function', basic just a function, inside the function return another fuction. For example: Decorators is a subset of high o
阅读全文
摘要:new.target is a new “magical” value available in all functions, thoughin normal functions it will always be undefined. In any constructor,new.target a
阅读全文
摘要:Each function should have a 'name' property. It can be anonymous, empty, the same as function name, or class name. For example:
阅读全文
摘要:Learn how to use console.table to render arrays and objects in a tabular format for easy scanning over the values. We'll create some mock data and the
阅读全文

浙公网安备 33010602011771号