Skip to content

Instantly share code, notes, and snippets.

@moznion
Created June 4, 2014 06:09
Show Gist options
  • Save moznion/fe92afccf032c6bcd72b to your computer and use it in GitHub Desktop.
Save moznion/fe92afccf032c6bcd72b to your computer and use it in GitHub Desktop.
chrome.storage.local.set({
"foo": Infinity
}, function () {
chrome.storage.local.get('foo', function (result) {
console.log(result['foo']); // <= undefined (Infinityにならない)
});
});
chrome.storage.local.set({
"foo": 42
}, function () {
chrome.storage.local.get('foo', function (result) {
console.log(result['foo']); // <= 42
});
});
chrome.storage.local.set({
"foo": Infinity
}, function () {
chrome.storage.local.get('foo', function (result) {
console.log(result['foo']); // <= 42 (Infinityにならず,直前に格納された値がそのまま)
});
});
chrome.storage.local.set({
"foo": undefined
}, function () {
chrome.storage.local.get('foo', function (result) {
console.log(result['foo']); // <= 42 (undefinedにならず,直前に格納された値がそのまま)
});
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment