<?xml version="1.0" encoding="utf-8"?>
<rss version="2.0" xmlns:dc="http://purl.org/dc/elements/1.1/">
<channel>
<title>Snipplr - Sephr</title>
<link>http://snipplr.com/users/Sephr/tags/js18</link>
<description>Recent snippets posted on Snipplr.com</description>
<language>en-us</language>
<pubDate>Thu, 23 May 2013 08:13:17 GMT</pubDate>
<item>
<title>(JavaScript) string.toCharCodes &amp;amp; String.fromCharCodes [JS 1.8]</title>
<link>http://snipplr.com/view/13069/stringtocharcodes--stringfromcharcodes-js-18/</link>
<description><![CDATA[ <p>*Requires JavaScript 1.8 or higher*

Syntax:

`Array string.toCharCodes()` returns an array containing every one of `string`'s character codes, in order.

`String String.fromCharCodes(charCodes)` returns a string created from every character code in the array, `charCodes`.</p> ]]></description>
<pubDate>Thu, 12 Mar 2009 19:58:56 GMT</pubDate>
<guid>http://snipplr.com/view/13069/stringtocharcodes--stringfromcharcodes-js-18/</guid>
</item>
<item>
<title>(JavaScript) fn.call and fn.apply [JS 1.8]</title>
<link>http://snipplr.com/view/12898/fncall-and-fnapply-js-18/</link>
<description><![CDATA[ <p>*Requires JavaScript 1.8*

fn.call and fn.apply are alternative methods to access function.call and function.apply and I don't see fn.call and fn.apply having any use but I made them for the heck of it.

Syntax:

`fn.call(function, [thisObject, [argument1, ..., argumentN]])` is equivalent to `function.call(thisObject, argument1, ..., argumentN)`

`fn.apply(function, [thisObject, [argumentsArray]])` is equivalent to `function.apply(thisObject, argumentsArray)`

Examples:

    function foo(a, b) (this*a)-b;
    fn.call(foo, 5, 6, 7) == 23
    foo.call(5, 6, 7) == 23
    fn.apply(foo, 5, [6, 7]) == 23
    foo.apply(5, [6, 7]) == 23</p> ]]></description>
<pubDate>Sat, 07 Mar 2009 13:15:22 GMT</pubDate>
<guid>http://snipplr.com/view/12898/fncall-and-fnapply-js-18/</guid>
</item>
<item>
<title>(JavaScript) Get Accessor (Getter/Setter) [JS 1.8]</title>
<link>http://snipplr.com/view/12835/get-accessor-gettersetter-js-18/</link>
<description><![CDATA[ <p>*Requires JavaScript 1.8*

`$[gs]etter(obj, property)` returns `function() obj.__lookup[GS]etter__(property).apply(obj, Array.prototype.slice.call(arguments))`

`object.get[GS]etter(property)` returns `$[gs]etter(this, property)`

Useful for getting the getters and setters of objects like `location`, so you can do stuff like location.getSetter("hash") to get the native hash-changing function.

Example:

    var foo = {a: 5}
    foo.__defineSetter__("bar", function(x) x/this.a)
    var fooBarSetter = foo.getSetter("bar") // $setter(foo, "bar") also works
    fooBarSetter(40) == 8
    
    var changeHash = location.getSetter("hash")
    changeHash("test")
    var getHash = location.getGetter("hash")
    getHash() == location.hash
    getHash() == "#test"
    
    function changeInnerHTML(el, html) el.getSetter("innerHTML")(html)
    changeInnerHTML(document.body, "test")
    document.getSetter("title")("Test")</p> ]]></description>
<pubDate>Thu, 05 Mar 2009 16:26:59 GMT</pubDate>
<guid>http://snipplr.com/view/12835/get-accessor-gettersetter-js-18/</guid>
</item>
<item>
<title>(JavaScript) base36 Encode/Decode [JS 1.8]</title>
<link>http://snipplr.com/view/12653/base36-encodedecode-js-18/</link>
<description><![CDATA[ <p>base36 Encode/Decode Strings
====================

*Requires JavaScript 1.8 or higher*

Syntax:

`base36[.ascii].encode(str[, separator]):String`

`base36[.ascii].decode(str[, separator]):String`

Default character separator is ZERO WIDTH SPACE U+200B

Examples:

    base36.encode("foobar", "-") == "2u-33-33-2q-2p-36"
    base36.decode("2u-33-33-2q-2p-36", "-") == "foobar"</p> ]]></description>
<pubDate>Fri, 27 Feb 2009 22:33:58 GMT</pubDate>
<guid>http://snipplr.com/view/12653/base36-encodedecode-js-18/</guid>
</item>
<item>
<title>(JavaScript) object.forEach [JS 1.8]</title>
<link>http://snipplr.com/view/12494/objectforeach-js-18/</link>
<description><![CDATA[ <p>object.forEach
=========
*Requires JavaScript 1.8*

`void object.forEach(function callback(item, value)[, thisObject])`</p> ]]></description>
<pubDate>Mon, 23 Feb 2009 00:59:57 GMT</pubDate>
<guid>http://snipplr.com/view/12494/objectforeach-js-18/</guid>
</item>
<item>
<title>(JavaScript) Easy Namespacing (JS 1.8)</title>
<link>http://snipplr.com/view/12489/easy-namespacing-js-18/</link>
<description><![CDATA[ <p>Easy Namespacing
================
*Requires JavaScript 1.8*

Examples:

`"foo.bar.baz".namespace()` makes `foo.bar.baz`

`"foo::bar::baz".namespace("::")` makes `foo.bar.baz`

`namespace.call(obj, ns[, separator])` extends `ns` (split by separator or ".") onto `obj`</p> ]]></description>
<pubDate>Mon, 23 Feb 2009 00:20:21 GMT</pubDate>
<guid>http://snipplr.com/view/12489/easy-namespacing-js-18/</guid>
</item>
</channel>
</rss>