This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
(function(){ | |
var first_words = ["iceman","animal"]; | |
var second_words = ["cinema","lamina"]; | |
check_anagrams(first_words, second_words); | |
function check_anagrams(first_words, second_words) { | |
// To print results to the standard output please use console.log() | |
// Example: console.log("Hello world!"); | |
function anagram(first_word,second_word){ | |
firstArr = first_word.split(''); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
var myHN = function (){ | |
var happyClosure = function(number){ | |
//started at | |
var timeStamp = new Date().getTime(); | |
//save original number | |
var happyNumber = number; | |
//iterations done |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
function attachEventApart(object, cB, event, onEvent){ | |
if (object.addEventListener){ | |
object.addEventListener(event, cB, false); | |
} | |
else if (window.attachEvent){ | |
object.attachEvent(onEvent, cB); | |
} | |
else | |
object[onEvent] = cB; | |
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
function* zs1(n) { | |
"use strict"; | |
if (n <= 0) throw new Error('positive integer only'); | |
yield [n]; | |
var x = new Array(n); | |
x[0] = n; | |
for (var i = 1; i < n; i++) x[i] = 1; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<html> | |
<head> | |
<title>Test Suite</title> | |
<script> | |
function assert( value, desc ) { | |
var li = document.createElement("li"); | |
li.className = value ? "pass" : "fail"; | |
li.appendChild( document.createTextNode( desc ) ); | |
document.getElementById("results").appendChild( li ); | |
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/* | |
* Updated to use the function-based method described in http://www.phpied.com/social-button-bffs/ | |
* Better handling of scripts without supplied ids. | |
* | |
* N.B. Be sure to include Google Analytics's _gaq and Facebook's fbAsyncInit prior to this function. | |
*/ | |
(function(doc, script) { | |
var js, | |
fjs = doc.getElementsByTagName(script)[0], |
NewerOlder