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.htmland 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
code1to an expression that evaluates to10. Use the numbers7and3and an arithmetic operator. - In one statement, initialize another variable named
code2to have a value of40. The40must be calculated using three numbers and the subtraction and division operators. - Create another variable named
code3with a value of39. The39should be calculated using at least one modulo operator. - Initialize a variable named
messageto have the value"The vault has been secured. The combination is:. - Initialize a variable named
codeAto have the value"10-40-39". This value must be calculated by concatenating the variablescode1,code2, andcode3. - Initialize a variable named
codeBto have the value"10-40-39". The value must be a single template literal that uses the variablescode1,code2, andcode3. - Use
console.logto printmessage,codeA, andcodeBto the browser console.
Please submit the link to your public GitHub repository.