Saturday, 27 April 2013
private variable to Javascript object literal
http://stackoverflow.com/questions/1396294/how-to-add-private-variable-to-this-javascript-object-literal-snippet
Thursday, 25 April 2013
#house music for work
http://www.youtube.com/watch?v=8BLupJDLR0w&list=RD02nEgbs5o_Lwo
Monday, 22 April 2013
Human Behavioral Biology StanfordUniversity
Human Behavioral Biology StanfordUniversity
https://www.youtube.com/watch?v=NNnIGh9g6fA&list=PLFDAC8A6702C57402
https://www.youtube.com/watch?v=NNnIGh9g6fA&list=PLFDAC8A6702C57402
Tuesday, 9 April 2013
S3 limit to objects in a bucket
According to Amazon:
Write, read, and delete objects containing from 1 byte to 5 terabytes of data each. The number of objects you can store is unlimited.
Source: http://aws.amazon.com/s3/ as of May 1, 2012.
http://stackoverflow.com/questions/3980968/s3-limit-to-objects-in-a-bucket
Monday, 8 April 2013
newrelic and heroku
If you use heroku newrelic as a add one it will create a new account so you can access it from here
heroku addons:open newrelic It will overwite the newrelic.yml file
heroku addons:open newrelic It will overwite the newrelic.yml file
Wednesday, 3 April 2013
heroku logs --tail
You may tail your logs using
--tail (or -t).$ heroku logs --tail
When you are done, press Ctrl-C to close the session.https://devcenter.heroku.com/articles/logging
Saturday, 30 March 2013
ECMAScript Language Specification
http://www.ecma-international.org/publications/files/ECMA-ST/Ecma-262.pdf
anonymous-function
This answer is not strictly related to the question, but you might be interested to find out that this kind of syntax feature is not particular to functions. For example, we can always do something like this:
alert(
{foo: "I am foo", bar: "I am bar"}.foo
); // alerts "I am foo"
Related to functions. As they are objects, which inherit from Function.prototype, we can do things like:
Function.prototype.foo = function () {
return function () {
alert("foo");
};
};
var bar = (function () {}).foo();
bar(); // alerts foo
One thing I found confusing is that the "()" are grouping operators.
Here is your basic declared function.
Ex. 1:
Functions are objects, and can be grouped. So let's throw parens around the function.
Ex. 2:
Now instead of declaring and right-away calling the same function, we can use basic substitution to declare it as we call it.
Ex. 3.
Finally, we don't have a need for that extra foo because we're not using the name to call it! Functions can be anonymous.
Ex. 4.
To answer your question, refer back to Example 2. Your first line declares some nameless function and groups it, but does not call it. The second line groups a string. Both do nothing. (Vincent's first example.)
But
|
http://stackoverflow.com/questions/1140089/how-does-an-anonymous-function-in-javascript-work
Subscribe to:
Posts (Atom)