Mind map
PROGRAM STRUCTURE
Map content
PROGRAM STRUCTURE
Variables
- Initialize: var tenbien = value;
Comment: // hoac /**/
I/O function basic
- console.log("text"): hien thi tren console
- alert("text"): hien thi thong bao
- confirm("Are you sure?") --> return true - click OK, false - click Cancel
- prompt("Nhap so", "so la..."): parameter1 cau y/c user nhap, para2 hien thi trong textinput
if-else
- if(condition){//do sth}
- if(condition) {//do sth} else {//do sth}
loop
- while (condition) { code block to be executed }
- do { code block to be executed } while (condition);
- for (statement 1; statement 2; statement 3) { code block to be executed }
- statement1: is executed before the loop starts, chi use 1 lan
- statement2: dk dung
- statement3: gtri lap
- var person = {fname:"John", lname:"Doe", age:25}; var text = ""; var x; for (x in person) { text += person[x]; }
switch-case
- switch(expression) { case n: code block break; case n: code block break; default: default code block }
- how it work
- switch expression is evaluated once
- ss expression = vs case ko
- if = -> thuc hien code trong case
- default: code to run if there is no case match
Information
- Description
- Beginner JavaScript Mind Map on PROGRAM STRUCTURE, created by Nguyet Huynh on 21/11/2016.
- Created by
- Nguyet Huynh
- Views
- 1
- Rating