IFSC 30003      HW5           Due by Wednesday, Oct. 1, 2025

Please email your assignment to: IFSC30003HW@gmail.com. You can paste most of your answers into the email itself, but some may need to be attachments.

 

1. Declare one function one way and the other a second way. One way is the common way that starts:

    function myFunc1.........

    and the other way shows what happens "under the hood" when declaring a function:

    let myFunc2=.........

     Declare a variable x, set it to the value of myFunc2, and run function x.

     The typeof of 5 is number. What is the typeof of variable myFunc?

Hand in the answer to the question above, and a screenshot showing your code running in a sandbox.

2. Make a function that calls itself once. Try to do it yourself before asking an AI for hints. If you do ask an AI, give it your partial code and ask for hints, rather than just asking it to give you the answer. This way you will learn something! Hand in the source code, and an explanation of if/how you used AI to help.

3. Call a function and print the result provided by the return statement. Then comment out the return statement. In your answer, say what it prints, and give the source code.

4. Print out the code of a function (that is, instead of calling it, print the code). Hand in screen shot of the sandbox showing code and result.

5. Declare an array. Print out its elements using a loop. Print out the length of the array.

6. Use https://claude.ai/public/artifacts/dd16d396-501c-4290-a680-94eb8bf111e4. Hand in a screen shot showing the final output.

7. Make a simple game in a web page containing Javascript. You can build on a game handed in for a previous HW or not, it's up to you. The game should help the player to learn about JavaScript arrays, focusing on the basics for students who are learning the basics of arrays in JS.