Coding / Programming Videos

Post your favorite coding videos and share them with others!

All posts tagged aaron

[JavaScript] Date, TimeStamp to Locale Date String – Aaron Lu – Medium

Source link Using Date.prototype.toLocaleDateString dateObject.toLocaleDateString([locales [, options]]); before: 1552800857541after: 2019/03/17 var now = new Date( var options = { year: ‘numeric’, month: ‘long’, day: ‘numeric’ }; console.log(now.toLocaleDateString(‘zh-TW’, { year: ‘numeric’, month: ‘2-digit’, day: ‘2-digit’})); // expected output: 2019/03/17 Source link  


[JavaScript] Web Storage API – Aaron Lu – Medium

Source link Storage Interface The Storage interface of the Web Storage API provides access to a particular domain’s session or local storage. It allows, for example, the addition, modification, or deletion of stored data items. Both localStorage and sessionStorage are instances of the Storage interface. Properties Storage.length Methods Storage.key(n): Return . . . Read more


[JavaScript] First-class Function 一級函式 – Aaron Lu – Medium

Source link 將函式作為參數來傳遞 Passing a function as an argument function sayHi() {return “Hi,”;} function greeting(hiMessage, name) {console.log(`${hiMessage()} ${name}!`);} // Pass `sayHi` as an argument to `greeting` functiongreeting(sayHi, “Tom”); 被當作參數傳遞的那個函式稱之為回調函式 Callback function。 sayHi 就是一個回調函式。 Source link  

Translate »