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
// https://medium.com/javascript-scene/master-the-javascript-interview-what-is-a-pure-function-d1c076bec976#.8n6883iyc | |
// Definition of a pure function | |
// Given the same inputs, a pure function will always return the same output, | |
// regardless of the number of times the function is called. | |
// Memorization and pure function goes well togther. Since pure function always return a predicatable value, | |
// this value can be cache using memorization. | |
// Non Pure |
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
/* | |
Resources: | |
- https://javascriptweblog.wordpress.com/2010/07/06/function-declarations-vs-function-expressions/ | |
- http://www.2ality.com/2011/04/ecmascript-5-spec-lexicalenvironment.html | |
*/ | |
// function declarations uses the VariableEnvironment as scope | |
function f() { | |
return 12; | |
} |
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
package | |
{ | |
import flash.display.Sprite; | |
import flash.events.Event; | |
import flash.net.*; | |
public class silk extends Sprite | |
{ | |
public function silk() | |
{ |