You have been hired to secure a vault! You must ensure that the client's family heirlooms are stored safely. In this workshop, you will write JavaScript to correctly set the codes for the vault's combination lock.
- Create a new repository under your GitHub account using this one as a template.
- Clone your repository down to your local machine and open it with VS Code.
- Live serve
index.html
and open the browser console.
In index.js
, write JavaScript according to the following steps. Make sure the JS file is connected to the HTML file!
- Declare a variable named
code1
. - In a separate statement, assign
code1
to an expression that evaluates to10
. Use the numbers7
and3
and an arithmetic operator. - In one statement, initialize another variable named
code2
to have a value of40
. The40
must be calculated using three numbers and the subtraction and division operators. - Create another variable named
code3
with a value of39
. The39
should be calculated using at least one modulo operator. - Initialize a variable named
message
to have the value"The vault has been secured. The combination is:
. - Initialize a variable named
codeA
to have the value"10-40-39"
. This value must be calculated by concatenating the variablescode1
,code2
, andcode3
. - Initialize a variable named
codeB
to have the value"10-40-39"
. The value must be a single template literal that uses the variablescode1
,code2
, andcode3
. - Use
console.log
to printmessage
,codeA
, andcodeB
to the browser console.
Please submit the link to your public GitHub repository.