Write a script, where you:
- Store the following Array:
[0,1,2,3,4,5]
- Create a function that increments each number in the array by one
- Call this function ten times
You can write the code in any way / code editor you want, as long as you are comfortable with what you choose.
It is recommended that you use Visual Studio Code, as it's the code editor we'll be using to teach this workshop, and is the one preferred by Spark AR Studio. If you want to execute your code (not required), you can use the playground
To start writing your script in Visual Studio Code:
- Open Visual Studio Code
> File > New File
- Select
Javascript
orTypescript
as your language - Start writing
You can also create a new Spark AR Project, head to the asset panel, create a new script (for this test, either Javascript or Typescript are OK), and open it in your code editor of choice.
See the practice-test-answer.md file to compare your answer.
You're probably wondering if there's a way to run/ execute your code and tell if it does well, instead of just comparing. The answer is that you'll learn how to run your code inside of Spark AR Studio later on, but for now, if you really want to execute your code, you can try using the playground
The real test will be similar to this one, don't worry, I won't try to trick you. However, for obvious reasons, you don't have the answers to that one.
You'll be presented a prompt, and asked to code out a solution (exactly like in the sample test). You'll need to send back your answer for it to be graded.
Just like in the sample test, it's not required that your code runs perfectly. If you happen to miss some symbol or misspell something, it's completely ok. I only care about the fact that you can reason through the prompt, and come up with a solution
You'll be able to send your answer as either a file, or by copying & pasting the answer into a text box