JavaScript Code
var str = "hi";
Memory allocation:
Address | Value | Description |
---|---|---|
...... |
... |
http://d.stavrovski.net/blog/post/how-to-install-and-setup-oracle-java-jdk-in-centos-6 | |
# rpm | |
wget --no-cookies \ | |
--no-check-certificate \ | |
--header "Cookie: oraclelicense=accept-securebackup-cookie" \ | |
"http://download.oracle.com/otn-pub/java/jdk/7u55-b13/jdk-7u55-linux-x64.rpm" \ | |
-O jdk-7-linux-x64.rpm | |
# ubuntu |
// This is *not* valid Go! | |
func Map(f func(A) B, xs []A) []B { | |
ys := make([]B, len(xs)) | |
for i, x := range xs { | |
ys[i] = f(x) | |
} | |
return ys | |
} | |
Map(func(x int) int { return x * x }, []int{1, 2, 3}) |
JavaScript Code
var str = "hi";
Memory allocation:
Address | Value | Description |
---|---|---|
...... |
... |
var flattenObject = function(ob) { | |
var toReturn = {}; | |
for (var i in ob) { | |
if (!ob.hasOwnProperty(i)) continue; | |
if ((typeof ob[i]) == 'object') { | |
var flatObject = flattenObject(ob[i]); | |
for (var x in flatObject) { | |
if (!flatObject.hasOwnProperty(x)) continue; |