Need some help on a code problem that my instructor did not really explain how to use Key
var terms = []; terms['JavaScript'] = "A really cool programming language"; terms['DOM'] = "When the browser loads a page, it creates a model of objects that represent each tag in the html (DOM stands for Document Object Model)"; terms['Array'] = "array is a single variable that is used to store different elements"; terms['Variable'] = "Variable means anything that can vary. JavaScript includes variables which hold the data value and it can be changed anytime. JavaScript uses reserved keyword var to declare a variable."; terms['Events'] = "interaction with HTML is handled through events that occur when the user or the browser manipulates a page. When the page loads, it is called an event."; // Problem 2 - Write a program to allow users to look up terms and definitions // Use the prompt() function to ask the user which JavaScript term they would like to look up (from the 'terms' array in problem 1). // Then use the alert() function to display the definition of the term. // If the term is not in the array, then display "That term is not in the array" in the alert message. var termsQ = prompt("Which javascript would you like to look up?"); var selectedTerm; console.log(termsQ); console.log(terms[key]); for( var key in terms){ if( termsQ == terms[key]){ var termsQ console.log(termsQ) } } if(selectedTerm){ alert("You Selected " + selectTerm) }else{ console.log(selectedTerm) }