TechEducationClone

JavaScritp

Java is NOT JavaScript

for my working page go here

Notes

what makes our page dynamic: html is sctucture css details (sofa) js what makes it all work

JS can store data and change based on user input. It is HUGE and can do a lot!

Variable in Programming

What is a variable? In programming, a variable is a value that can change, depending on conditions or on information passed to the program. Typically, a program consists of instruction s that tell the computer what to do and data that the program uses when it is running. js_variables

The var keyword was used in all JavaScript code from 1995 > to 2015.
The let and const keywords were added to JavaScript in 2015.
The var keyword should only be used in code written for older browsers.

Errors

Notes from app.js file

// data types

// arethemetic operators

// Comparison operators

// Methods
// consol.log()
// prompt()
// document.write() !!! DO NOT USE THIS AS IT WILL OVERWRITE HTML
// alert() will show a message to the user

let userName = prompt(“Hi user :) please tell me your prefered name!”)
console.log(userName)
// if (userName == “Je”){ // } else (alert(“Please enter your name”))

const welcomeMsg = alert(“Welcome to my page “ + userName)

document.write()

Q&A

  1. What are variables in JavaScript?

    In programming, a variable is a value that can change, depending on conditions or on information passed to the program.

  2. What does it mean to declare a variable?

    Declaration of a variable in a computer programming language is a statement used to specify the variable name and its data type. Declaration tells the compiler about the existence of an entity in the program and its location. When you declare a variable, you should also initialize it.

  3. What is an “assignment” operator, and what does it do?

    The assignment operator = assigns the value of its right-hand operand to a variable, a property, or an indexer element given by its left-hand operand. The result of an assignment expression is the value assigned to the left-hand operand.

  4. What is information received from the user called?

    we use the prompt() function to ask the user for input. As a parameter, we input the text we want to display to the user. Once the user presses “ok,” the input value is returned. We typically store user input in a variable so that we can use the information in our program.

Links

js Functions