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

PREVIOUS NEXT
Code Example
Javascript :: Javascript first example 
Javascript :: react handling event 
Javascript :: javascript pipe async functions 
Javascript :: if is a string javascript 
Javascript :: Document object not defined Next js 
Javascript :: multiselect checkbox 
Javascript :: node js file extension 
Javascript :: express router 
Javascript :: regex validate email 
Javascript :: usestate in react 
Javascript :: react-datepicker 
Javascript :: working with multiple db in single query mongodb 
Javascript :: rating 
Javascript :: js map on object 
Javascript :: callback in javascript 
Javascript :: update column with find sequelize 
Javascript :: passport jwt strategy 
Javascript :: timer javascript 
Javascript :: string en javascript 
Javascript :: giphy javascript github 
Javascript :: js button to take current page screenshot 
Javascript :: jquery like selector in javascript 
Javascript :: changing parent function states in child function 
Javascript :: ascending order sort javascript without sort function 
Javascript :: gdscript create node 
Javascript :: crypto 32 characers encryption node js 
Javascript :: Instar y crear proyecto AdonisJS 
Javascript :: feathersjs mysql example 
Javascript :: nodejs postgresql scalar query 
Javascript :: passportjs mac req.user not saved 
ADD CONTENT
Topic
Content
Source link
Name
6+3 =