current position:Home>Front end JS variable exercise topic

Front end JS variable exercise topic

2022-01-26 22:14:55 Dunhuang Bi painting

Variable operation

  1. What is the purpose of variables ?

    • Store the data
    • For the beauty of the code
  2. let and const The difference between declared variables is :

    let Declared variables can be left unassigned ,const The declared variable must be assigned , Otherwise, the report will be wrong 
    
  3. let The correct result of repeating the declaration of variables is ?

    • Overwrite the original value
    • Report errors
    • No impact
    • Both values are saved in variables
  4. What is constant ? A constant quantity __

  5. After the following code is run , The right result is ?

    const a;
    const b = 2;
    a = 1;
    console.log(a + b);
    
    • Output 3
    • Report errors
    • Output 2
    • Output 4
  6. In what situation does the following sentence appear

    a is not defined

    • Use an undeclared variable a
    • Variable a Incorrect declaration command used when declaring
    • Declare variables a There is no ending sign when writing
    • Variable a Not used after declaration
  7. Variables should be used before they are declared

    • Yes
    • incorrect
  8. Which of the following are the correct keywords for declaring variables ?

    • let
    • const
    • var
    • int
  9. Which of the following symbols are JS Annotators in

    • //
    • /**/
    • <!-- -- >
    • #

copyright notice
author[Dunhuang Bi painting],Please bring the original link to reprint, thank you.
https://en.cdmana.com/2022/01/202201262214534204.html

Random recommended