travisbyr / Lab-Two

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Lab-Two

Journal Entry 3

What

This week we learnt about using javascript operators. We did this by doing group coding and practising the use of javascript operators. We learnt about the variety of javascript opeartors that can be used, such as mathematical, comparable, logical bitwise and conditonal. We also learnt how to effectively implement these operators to create post and pre incrementing calculations that increments a integer variable. We also learnt about the meaning of null and undefined variables and what the calculation will show when comapred and added to integers and strings. We also learnt the use of or, and, equals and does not equal to operators.

Why

The variety of javascript operators are good to learn as they can be used effetively to create applications. It is almost guaranteed that while creating an application that their will be a javascript operator used. By learning these operators I am able to implement these into the programs I create. These operators will enable me to calculate and recieve a solution from functions, if statements and other code processes. Operators will be very useful in helping me create and develop programs in the future/

How

While learning this skill, we noticed that not all operators will work together, and depending on the data type used, somes operators will not work out the problem correctly. For example, when we try to compare an integer to an integer that is a string, the calculation is true. But when we try to calculate the same calculation using a triple equals symbol (===) the calculation is false. This is we are comparing two variables that have a different data type. When a double/normal equals symbol is used (==), the integer in a string is acknowledge as an integer regardless of whether its being classed as a string. Although for a triple equals symbol (===) the datatypes are represented as what they are being classed (e.g integers not in quotation marks are integers, integers in quotation marks are strings. This is because the triple equals symbol is called an 'identical operator', meaning it compares two variables that are identical, having the same properties and value. Where as the double equals symbol called the 'equal operator' only looks for data values that are equal to each other. An indentical operator compares using all the properties of the variable where an equal operator only compares using the value.

Image of Code

About

License:MIT License


Languages

Language:JavaScript 100.0%