随笔分类 -  Javascript

上一页 1 ··· 6 7 8 9 10 11 12 13 14 ··· 30 下一页
摘要:The ability to natively format dates and times using the browser is impressive. You may find yourself not needed to grab libraries such as moment.js o 阅读全文
posted @ 2020-08-06 04:22 Zhentiw 阅读(114) 评论(0) 推荐(0)
摘要:JavaScript numbers and CSS hexadecimal numbers don't play very well together. You can solve this with a conversion function that takes the number, con 阅读全文
posted @ 2020-07-27 16:09 Zhentiw 阅读(91) 评论(0) 推荐(0)
摘要:State + Event + Interpreter: const machine = { initial: "idle", states: { idle: { on: { FETCH: "pending", }, }, pending: { on: { RESOLVE: "resolved", 阅读全文
posted @ 2020-07-15 03:17 Zhentiw 阅读(180) 评论(0) 推荐(0)
摘要:import './assets/css/style.css'; const app = document.getElementById('app'); app.innerHTML = ` <div class="todos"> <div class="todos-header"> <h3 clas 阅读全文
posted @ 2020-06-28 21:55 Zhentiw 阅读(193) 评论(0) 推荐(0)
摘要:Let's see the following code first: let button = document.getElementById("button"); button.addEventListener("click", (e) => { console.log(e) }); We ha 阅读全文
posted @ 2020-05-13 18:16 Zhentiw 阅读(355) 评论(0) 推荐(0)
摘要:Macro: refer to webapis, setTimeout, setInterval Micro: refer to Promise based api Execution order Sync Task > Micro Task > Macro Task Example: const 阅读全文
posted @ 2020-04-27 18:10 Zhentiw 阅读(144) 评论(0) 推荐(0)
摘要:Big or non decimal numbers are sometimes hard to read inside code. Numeric separators are now part of the javascript specification and allow us to mak 阅读全文
posted @ 2020-04-15 01:57 Zhentiw 阅读(388) 评论(0) 推荐(0)
摘要:When implementing the store partten, we need to be careful about mutation. class DataStore { private lessons: Lesson[] = []; private lessonsSubject = 阅读全文
posted @ 2020-04-05 01:18 Zhentiw 阅读(153) 评论(0) 推荐(0)
摘要:const app = document.getElementById('app'); app.innerHTML = ` <h1>JavaScript DOM</h1> <ul id="list"> <li>1</li> <li>2</li> <li>3</li> <li>4</li> </ul> 阅读全文
posted @ 2020-03-30 02:07 Zhentiw 阅读(156) 评论(0) 推荐(0)
摘要:const app = document.getElementById('app'); app.innerHTML = ` <h1>JavaScript DOM</h1> <div class="item"></div> `; const item = document.querySelector( 阅读全文
posted @ 2020-03-30 02:06 Zhentiw 阅读(106) 评论(0) 推荐(0)
摘要:In this lesson we will learn about how to define real private properties in javascript classes. Before: class Pasta { constructor(name) { this._name = 阅读全文
posted @ 2020-03-26 18:29 Zhentiw 阅读(132) 评论(0) 推荐(0)
摘要:Generators can yield promises which can work with the "for await of" loop syntax. This lesson shows how all the pieces fit together and explains why t 阅读全文
posted @ 2020-03-22 02:59 Zhentiw 阅读(174) 评论(0) 推荐(0)
摘要:The "for await of" loop syntax enables you to loop through an Array of Promises and await each of the responses asynchronously. This lesson walks you 阅读全文
posted @ 2020-03-22 02:55 Zhentiw 阅读(116) 评论(0) 推荐(0)
摘要:NaN == NaN // false NaN NaN // false Object.is(NaN, NaN) // true Number.isNaN(NaN) // true typeof NaN // number Because NaN is number type, so there i 阅读全文
posted @ 2020-03-22 02:24 Zhentiw 阅读(165) 评论(0) 推荐(0)
摘要:-0 0 // true 阅读全文
posted @ 2020-03-22 02:19 Zhentiw 阅读(245) 评论(0) 推荐(0)
摘要: 阅读全文
posted @ 2020-03-22 02:16 Zhentiw 阅读(149) 评论(0) 推荐(0)
摘要:Learn how to use custom events to expose internal events from withing a web component. class MyWelcome extends HTMLElement { constructor() { super(); 阅读全文
posted @ 2020-03-11 16:31 Zhentiw 阅读(171) 评论(0) 推荐(0)
摘要:What makes objects different is that we can create more of them. Every time we use the {} object literal, we create a brand new object value: let shre 阅读全文
posted @ 2020-02-25 18:46 Zhentiw 阅读(103) 评论(0) 推荐(0)
摘要:Let's see a simple code example: let pet = "dog" console.log(pet) We have console.log(pet) inside the code, when you read it, you might say: Pass ´pet 阅读全文
posted @ 2020-02-24 18:39 Zhentiw 阅读(142) 评论(0) 推荐(0)
摘要:It can be confusing to understand when and how the .prototype and .proto properties are created and used. They both seem to imply having something to 阅读全文
posted @ 2020-02-21 20:36 Zhentiw 阅读(202) 评论(0) 推荐(0)

上一页 1 ··· 6 7 8 9 10 11 12 13 14 ··· 30 下一页