JavaScript AJAX Concepts
11 Questions
0 Views

Choose a study mode

Play Quiz
Study Flashcards
Spaced Repetition
Chat to Lesson

Podcast

Play an AI-generated podcast conversation about this lesson

Questions and Answers

What is the purpose of the function called prompt() ?

  • To display a message without asking for intriing
  • To ask for the user's age and display a message
  • To display a message without asking for the user's name
  • To ask for the user's name and display a message (correct)

What is the use of the '+' operator in JavaScript?

  • To add numbers
  • To divide values
  • To concatenate strings (correct)
  • To subtract strings

What are the two ways to add JavaScript to a web page?

  • Embed JavaScript code in an HTML file and link to a separate JavaScript file (correct)
  • Link to a separate HTML file and embed JavaScript code in a CSS file
  • Embed JavaScript code in an HTML file and link to a separate CSS file
  • Link to a separate CSS file and embed JavaScript code in a JavaScript file

What is the purpose of the

<p>To embed JavaScript code in an HTML file (D)</p> Signup and view all the answers

Where can the

<p>Inside the or tag (B)</p> Signup and view all the answers

What are function parameters used for?

<p>To take inputs and help the function run (C)</p> Signup and view all the answers

What happens when a function is called?

<p>It takes inputs and returns a value when complete (B)</p> Signup and view all the answers

What is the purpose of the 'prompt()' method?

<p>To ask the user for input (D)</p> Signup and view all the answers

What is the purpose of the 'alert()' method?

<p>To display a message on the screen (B)</p> Signup and view all the answers

How many times is the 'greeting' function called in the example?

<p>Twice (D)</p> Signup and view all the answers

What is stored in the variable 'name'?

<p>The user's name entered through the prompt (D)</p> Signup and view all the answers

More Like This

Use Quizgecko on...
Browser
Browser