Interview Preparation
System Design Interview
Objective
May 10, 2013
What is the output of following JavaScript code?
<script type="text/javascript">
function sum(x)
{
function add(y)
{
return x+y;
}
return add;
}
function callme()
{
result=sum(4)(5);
alert(result);
}
</script>
If you call the function callme(), what will happen?
Detailed Explanation
Option A is the right Answer
Discussion (0)
No comments yet. Be the first to share your thoughts!
Share Your Thoughts