Thread:Mathmagician/@comment-3508190-20120504092551/@comment-4674838-20120504194152

Okay, so, the way you're using the API above is only the small segment of code starting with $.get. That's a jQuery HTTP Get request. If the request is successful, the instructions given by the callback function (I'm not familiar with what that is) are executed.

getYoutubeClipTitle('http://www.youtube.com/watch?v=mk17xA-JM3k', function (title) {   console.log(title); }); ^Can you explain to me what this code is doing? It appears to me almost like you're passing function (title) { console.log(title); } as a parameter -- an inline function definition but the function is unnamed or something? And it's done again above when you pass '' function (document) { callback($(document).find('title').text); } '' to $.get. You can pass a function definition as a parameter to another function? I'm confused here, I've never seen this in other languages before. Passing (the return value of) a function call as an actual parameter or passing a pointer to a function makes sense to me, but the body of a function?