Clear an array
array.length = 0
linq.js example
Enumerable
.from(some_array)
.where(i => i.prop == test_value)
.select(i => {"a":i.a_val, "b":i.b_val})
.distinct(s => s["a"])
.toArray();
jQuery create new element, attach an event, and add it to the list of elements of a parent element
jQuery("<span id='test'>Some text</span>")
.on("click", function() { alert(this.id + ' clicked') })
.append("#container");
jQuery clear contents of an element
jQuery("#target").empty();
URL encode/decode string
encodeURIComponent(string); //to URL econded unescape(string); //from URL encoded