Questions to master – front end dev related

May 25th, 2010

javascript

Provide an example of closure in javascript.
How do you create an object using a function constructor?
How would you dynamically populate the following into all elements with a class name of ?news-story? on a page using a) jQuery and b) raw javascript:
JSON:

{“items”: [
{
"title": "sample 1",
"author": "author 1"
},
{
[...]

Posted in Curiosities, The Industry