Profile
Achievement
EvanHahn's Recent JavaScript Snippets
- All /
« Prev 1 Next »
Here's how to use this:
* To access something in the local storage, type `Evan.local('name')`. You may need to use `JSON.parse()` on this result. Returns `null` if nothing's there.
* To assign something in the local storage, type `Evan.local('nam...
1
589
posted 12 years ago by EvanHahn
This prepends a `#` if it's not already there. Useful when doing jQuery selectors.
0
477
posted 12 years ago by EvanHahn
`Object.create(null)` is a more memory-efficient way to make objects, but it's not supported in all versions of JavaScript, so you can do the "old-fashioned" `{}` if that function isn't available.
0
664
posted 12 years ago by EvanHahn