JSFiddle - React, Tailwind, and code Playground
by seankoole
JavaScript
/*
jQuery 1.4.2 vs 1.4.3 -- data method extends and uses JavaScript object, instead of using internal cache
Default is set to 1.4.3, select 1.4.2 and click run
*/
var c = {};
/*
1.4.3 = {}
1.4.2 = {}
*/
console.log (JSON.stringify (c));
/*
Add data to the object
*/
$.data (c, 'foo', 'baz');
/*
1.4.3 = {"foo":"baz"}
1.4.2 = {"jQuery1287245056592":2} (cache expando)
*/
console.log (JSON.stringify (c));
/*
Change the objects property value not using data
*/
c.foo = 'something else';
/*
1.4.3 = something else
1.4.2 = baz (from cache)
*/
console.log ($.data (c, 'foo'));