Search
 
SCRIPT & CODE EXAMPLE
 

JAVASCRIPT

quiz javascript

YOUR MISSION
Google maps recently discovered a mysterious place last week...
They need you to calculate new data on this unknown archipel...
Do you feel ready to continue this adventure?
 
INSTRUCTIONS :
Return the truncated percentage of islands on the map.

EXEMPLES
[
  [0,0,0,0,0],
  [1,1,0,0,0],
  [1,1,0,0,0],
  [0,0,0,1,1],
]
=>30%
const map=[
  [0,0,0,0,0],
  [1,1,0,0,0],
  [1,1,0,0,0],
  [0,0,0,1,1],
];
function count Islands(map){
  return map.reduce((count Island,row)=>{
    return count Island+row.filter(Boolean).length
  },0);
}
Comment

how to make a quiz in javascript

There are several steps: 
1. Learn Javascript
2. Solve some questions
3. Read Javascript code
4. Start making some simple questions
5. Get someone's feedback
6. Improve the quality of questions
7... Do it again and again
Comment

JavaScript quiz

Inside which HTML element do we put the JavaScript?
 1. <script>
 2.<js>
 3.scriptinf>
 4.<javaScript>
 
 answer : <script>
<!-------------------------------------------------->
  
- What is the correct JavaScript syntax to change the content of the HTML element below?

<p id="demo">This is a demonstration.</p>
1. document.detElementById("demo").innerHTML="Hello Mohammad"
2. document.detElementBy("demo").innerHTML="Hello Mohammad"
3. detElementById("demo").innerHTML="Hello Mohammad"
4. document.detElementById("demo")="Hello Mohammad"

answer : 1. document.detElementById("demo").innerHTML="Hello Mohammad"
<!-------------------------------------------------->

-Where is the correct place to insert a JavaScript?

1. in the <body>
2. in the <head>
3. in both <head> and <body>  
  
answer: 3. in both <head> and <body>  

<!-------------------------------------------------->
-What is the correct syntax for referring to an external script called "xxx.js"?
1.<script src="xxx.js">
2.<script name="xxx.js">
3.<script href="xxx.js">
  
answer : 1.<script src="xxx.js">
<!-------------------------------------------------->

-The external JavaScript file must contain the <script> tag.
1.true
2.false

answer: 2.false
<!-------------------------------------------------->


Comment

javascript quiz questions and answers

Below are some helpful JS questions and awnsers to test you JS skills:

Q1) - Which of the following is an advantage of using JavaScript?
A - Less server interaction
B - Immediate feedback to the visitors
C - Increased interactivity
D - All of the above.
(ANSWER) - D

Q2) - Can you assign a anonymous function to a variable?
A - true
B - false
(ANSWER) - A

Q3) - Which of the following type of variable takes precedence over 
other if names are same?
A - global variable
B - local variable
C - Both of the above.
D - None of the above.
(ANSWER) - B

Q4) - Which built-in method reverses the order of the elements of 
an array?
A - changeOrder(order)
B - reverse()
C - sort(order)
D - None of the above.
(ANSWER) - B

Q5) - Which of the following function of Array object applies a function 
simultaneously against two values of the array (from right-to-left) as to 
reduce it to a single value?
A - pop()
B - push()
C - reduce()
D - reduceRight()
(ANSWER) - D
Comment

PREVIOUS NEXT
Code Example
Javascript :: jquery get parent element 
Javascript :: how to access value of itself object in javascript 
Javascript :: how to store variable in local storage angualur 
Javascript :: example of callback function in javascript 
Javascript :: Working of Recursion in C++ 
Javascript :: js octal 
Javascript :: angularjs select placeholder 
Javascript :: discord.js lock channel 
Javascript :: material ui table row height 
Javascript :: login js 
Javascript :: is there an api for netflix shows 
Javascript :: jquery edit href 
Javascript :: JS longest word 
Javascript :: remove element from object javascript 
Javascript :: min in array 
Javascript :: vuejs how use this.$slots.default 
Javascript :: array of array of string js 
Javascript :: php math 
Javascript :: check if string javascript 
Javascript :: jquery check if eleme 
Javascript :: loading button jquery 
Javascript :: js loop array back 
Javascript :: how to change a sting into js code 
Javascript :: errorMessage is not defined 
Javascript :: LEARN JAVASCRIPTWhale Talk 
Python :: ignore warnings python 
Python :: how to change django admin text 
Python :: python use tqdm with concurrent futures 
Python :: check if message is in dm discord.py 
Python :: python list files in current directory 
ADD CONTENT
Topic
Content
Source link
Name
4+6 =