learning-journal

102-Learning journal

This project is maintained by cmboell

Programming With JavaScript

Introduction and Chapter 1a: The ABC of Programming (pages 1-24)

JavaScript can be used to make websites mroe interactive. You can use JavaScript to select any element, attribute, or text from an HTML page. You can also use it to add elements, attributes, and text to a page as well as to remove them. You can specify a set of steps for the browser to follow, which allows it to access or change the content of a page. You can specify that a script should run when a specific event has occurred (such as button being pressed, a link has been clicked, a cursor hovers over an element, info is added to a form, an interval of time has passed, a web page has finished loading, etc.)

A script is a series of instructions that a computer can follow to achieve a goal. When writing a script you need to first state your goal and then list the tasks that need to be completed in order to achieve it. Start with the big picture of what you want to achieve and then break it down into smaller steps. You should define your goal, design the script, and then code each part.

Remember that computers solve problems programmatically; they follow a series of instructions, one after another.

Chapter 2:Basic JavaScript Instructions (pages 74-79)

An expression evaluates into (results in) a single value. There are two types of expressions:

Expressions rely on things called operators. They allow programmers to create a single value from one or more values.

JavaScript contains the following mathematical operators, which you can use with numbers: + - / * ++ -- % etc.

Chapter 2 (pages 88-94)

Functions let you group a series of statements together to perform a specific task. If different parts of a script repeat the same task, you can reuse the function (rather than repeating the same set of statements). In order to us a function you must first declare it by using the function keyword and then the function name and then the statement. After you have done that you must call that function to use it using the function name. After declaring a function once you may use it as many times as you would like in the same JavaScript file. Some functions use variables to get information and to process correctly. When using variables you specify the values it should use, those values are called arguements. They can be provided as a simple value or a variable. It is important that you enter your code correctly so that you recieve the correct output when it is ran.