javascript 101

    console.log("Hello from JavaScript");
    var condition = true || false
    console.log(condition)
    var age = 25 
    
    var condition = age > 18 
    
    function trueCondition(){
        console.log("azer is a good developer") 
        console.log("kabroun")
    }
    
    condition ? 
    // true : age > 18
    trueCondition()
    
    : 
    var name = "azer"
    
    switch(name){
        case "azer" :
            console.log("20")
            break 
        case "amine" :
            console.log("25")
            break
             
    }
    
    
    // = set value
    var age 
    age = 20
    
    
    // == value comp
    
    var a = 5 
    var b = "5"
    
    console.log(a == b)
    
    // === value and type com
    
    for(var i = 1 ; i <= 50 ; i = i + 1){
        // something
        console.log( i , " azer")
        console.log("i am counting i")
    }
    var i = 0 
    
    while(i < 5){
        console.log(i)
        i++ 
    }
    
    console.log("no")
    function myFunction(){
        console.log("azer")
        console.log(80) 
    }
    
    
    function lie(nameInput , ageInput , pcInput){
        nameInput = "si " + nameInput
        ageInput  = ageInput + 5
        pcInput = pcInput + " mac"
        
        var message = nameInput + " is " + ageInput + " and 3andou " + pcInput 
        console.log(message) 
    }
    
    
    var name = "azer"
    var age = 20
    var pc = "asus"
    
    function plus(a , b){
        return a + b
    }
    
    
    
    console.log(plus(3,4))
    console.log(plus(13 , 7))
    // array     0   1    2    3
    var ages = [20 , 25 , 24 , 18]
    console.log("the length of the age arrey is " , ages.length)
     
    ages.push(55)
    ages.push(79)
    
    ages.push(13)
    
    for(var i = 0 ; i < ages.length ; i++){
        console.log(ages[i])    
    }
    
    console.log("the length of the age arrey is " , ages.length)
    var user = {
        name : "azer" ,
        age : 20 ,
        email : "azer@gmail.com" ,
        id : "789798" ,
        hash : "ze5za4e54za5e4zae465az4e56za46e"
    }
    
    var post = {
        content : "hello my friends " ,
        likes : 50 ,
        comment : 12 ,
        shares : 2 
    }
    var users = ["azer" , "amine" , "ons" , "ahmed" , "john"]
    
    //console.log(users)
    
    var fbPoste = {
        content : "hello my dear friends " ,
        likes : 25 ,
        comments : 15 ,
        shares : 2
    }
    var user = {
        name : "azer" ,
        age : 20 ,
        computer : "asus"
    }
    
    var users = [
        {
            name : "azer" ,
            age : 20 ,
            computer : "asus"
        } , 
        {
            name : "ons" ,
    var user = {
        name  : "azer" , 
        age : 20 ,
        sayHi(){
            console.log("hello "  + user.name)
        }
    }
    
    console.log(user.age)
    
    user.sayHi()
    // let's generate an object
    
    function user(name , age , pc){
        return {
            name : name ,
            age : age ,
            pc : pc
        }
    }
    
    var azer = user("azer" , 20 , "mac")
    var amine = user("amine" , 25 , )
    console.log(azer)
    function output(){
        console.log("hello folks !")
    }
    
    console.log("welcome")
    
    setTimeout(output , 1000) ;
    
    
    // setInterval()
    
    function myName(){
        console.log("azer")
    }
    
    setInterval(myName , 1000)
    
    function repeat(n , myFunction){
        for(var i = 0 ; i < n ; i++){
            myFunction()
        }
    }
    
    function story(){
        console.log("we 're the chompions ! ")
        console.log("we're the winners !")
        console.log("tattanntata")
    }
    
    repeat(3 , story)

introduction to javascript programming language