29. Local Storage
JavaScript
var obj = {‘name’:‘val”};
localStorage.setItem(‘key’, JSON.stringify(obj));
var data = JSON.parse(localStorage.getItem(‘key’));
53. Minify
Before
/**
* chikuwa.js
* Copyright (c) 2011 CyberAgent, Inc.
* License: MIT (http://www.opensource.org/licenses/mit-license)
* GitHub: https://github.com/suguru/chikuwa.js
*/
(function(w) {
var doc = w.document,
root = w.document.documentElement,
cssnum = {'column-count':1,columns:1,'font-weight': 1,'line-height':1,opacity:1,'z-index':1,zoom:1},
slice = Array.prototype.slice;
// is string
function isString(o) { return typeof o === 'string' ¦¦ o instanceof String; }
// is function
function isFunction(o) { return typeof o === 'function' ¦¦ o instanceof Function; }
// is number
function isNumber(o) { return typeof o === 'number' ¦¦ o instanceof Number; }
// is chikuwa object
function isChikuwa(o) { return o instanceof chikuwa; }
// is object
function isObject(o) { return o instanceof Object; }