Question: (c) You have the following javascript function: Line 1 function unknown2 (str)( Line 2 Line 3 Line 4 rest; Line 5 Line 6 var letter
(c) You have the following javascript function: Line 1 function unknown2 (str)( Line 2 Line 3 Line 4 rest; Line 5 Line 6 var letter = str.charAt(0); va r rest = word . substring (1); var newWord = letter.toUpperCase() + return "Hello "newWord; Assume we make a call to the above function in the form of unknown2 (friend). (i) What would be the value of the local variable letter, after the (ii) What would be the value of the local variable rest, after the (ii) What would be the value of the local variable newWord, after the (iv) What would the function call unknown2( 'friend') return as execution of Line 2? execution of Line 3? execution of Line 4? an output
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
