JavaScript - WDD330📱

avaScript is one of the most used programming languages in the world, and JavaScript is responsible for the interactivity of the websites

Your First program in JavaScript Hello World

    console.log('Hello World');
   

This code will be printed in your console Hello World, to add the Javascript in your HMTL you can add with the tag example of that as follows:

    const btn = document.getElementById()
        btn.addEventListener('click', function() {
            alert('Hello World!');
        };
  

you can call a JavaScript file example of that is as follows, you need to add the and the open and close tag of the script:

    
        script src='js/helloWorld.js'
        
    

To create a comment a peace of test that the computer will not read the comment is design for programmer to organize the code or only explain any logic or objective for peace of to comment we use// or /*comment*/

Scope

Arrays

Logic Conditionals

Loops

Functions

Questions?

What is the difference between functions and arrow functions in what scenario you can use it?

JavaScript is not a class-based object-oriented language. But you still have ways to use object-oriented programming (OOP).

Contact me

📧Email me at iodaniel@byui.edu