loading
The Countinuation-Passing Style in JavaScript

JavaScript Notes

2018.12.21

The Countinuation-Passing Style in JavaScript

In JavaScript, a callback is a function that is passed as an argument to another function and is invoked with the result when the operation completes. In functional programming, this way of propagating the result is called continuation-passing style (CPS). It simply indicates that a result is propagated by passing it to another function (the callback), instead of directly returning it to the caller.

Practising closures in JavaScript

JavaScript Notes

2018.12.17

Practising closures in JavaScript

JavaScript is a very function-oriented language. As we know, functions are first class objects and can be easily assigned to variables, passed as arguments, returned from another function invocation, or stored into data structures. A function can access variable outside of it. But what happens when an outer variable changes? Does a function get the most recent value or the one that existed when the function was created? Also, what happens when a function invoked in another place - does it get access to the outer variables of the new place?

JS 本地数据存储之 cookie

JavaScript Notes / Web Notes

2018.03.09

JS 本地数据存储之 cookie

本来只是想简单看看 cookie、localStorage 和 sessionStorage 的,没想到一搜索扩展了很多知识,但是,中心主题还是集中在 web storage (localStorage, sessionStorage) 的认识上,以及怎么使用它们。不过,在此之前,先来简单认识一下 cookie 吧。

初识 ES6

JavaScript Notes

2018.03.08

初识 ES6

虽然 ES8 已经发布,但是以我的基础来说还是从 ES6 (ECMAScript 2015) 开始,此番就跟着 JavaScript by Example 这本书来学习,随手记点笔记,以期长点记性。

使用 Disqus API 加载最近评论

Web Notes / JavaScript Notes

2016.04.13

使用 Disqus API 加载最近评论

Disqus 以前提供了最近评论的 JavaScript 代码,但是官方提示说不再继续支持,而是提供了新的 Disqus API 供开发者使用。那么我们好好把 Disqus API 用起来,做一个最近评论的列表吧。

TRENDING