diff --git a/functionExercise.js b/functionExercise.js new file mode 100644 index 0000000..53ceccf --- /dev/null +++ b/functionExercise.js @@ -0,0 +1,33 @@ +function addition(){ + var a = 13 + var b = 44 + var c = a + b + Console.log("13 + 44 = " , c) +} + +function subtraction(){ + const d = 56 + const e = 8 + const f = d - e + Console.log("56 - 8 = " , f) +} + +function multiply(){ + let value1 = 3 + let value2 = 5 + let multiplyValues = value1 * value2 + Console.log( "3 * 5 = ", multiplyValues) + +} + +function divide(){ + var g = 8 + var h = 3 + float i = g / h + Console.log( "8/3 = ", i) +} + +addition() +subtraction() +multiply() +divide() \ No newline at end of file diff --git a/index.css b/index.css index 937a537..f5cb900 100644 --- a/index.css +++ b/index.css @@ -71,7 +71,9 @@ body { flex-direction: row; flex-wrap: wrap; width: 75%; + background-color: red; + border-bottom-left-radius: 15px; } diff --git a/index.html b/index.html index a494ee6..03380ab 100644 --- a/index.html +++ b/index.html @@ -2,13 +2,26 @@ + + + +
+

rw400

+ +

1.2

- +<
diff --git a/index.js b/index.js new file mode 100644 index 0000000..aecf940 --- /dev/null +++ b/index.js @@ -0,0 +1,118 @@ +// ; is optional in modern javascript, make sure it is consistent +var x = 5.5 //number +console.log(x) //prints to the terminal, browser +console.log("this is test:) + +var x2 = 5.5 + +var x3 = x + x2 +console.log(x3) +console.log("value", x3) + +var x = 99 //override x value +console.log(x) //new x value in console + +var x = "this is a string" //override again to string +console.log("x", x) + +var string = x + "9" // string concatenation +console.log(string) + +var y = "blockchain" //string + +var z = y + x +console.log(z) + +const firstname = "John" //cannot override, change +const lastname = "Doe" +const fullname = firstname + " " + lastname +console.log(fullname) + +var nnumber_1 = 55 //underscores are fine but not - +var numberNumber = 66 //standard way of defining lowercase then uppercase +var sum = number_1 + numberNumber +console.log(sum) + +var difference = number_1 - numberNumber //subtraction +console.log(difference) + +var string1 = "string concatation" +console.log(string1.length) // gives length of string + +var upperString = string2.toUpperCase() //Caps all the values +Console.log(upperString) + +var lowerString = upperString.toLowerCase() //Lowercase all values +Console.log(lowerString) + +function demoFunc() { + console.log("this is a funciton") + var a = 22 + var b = 33 + var c = a + b + Console.log(c) +} + +demoFunc() + +funciton secondFunction(){ + const x = 3; + const y = "number" + const z = x + y //auto detects as string 3number is now a string + console.log("z : ", z) +} +secondFunction() + +function awesomeFunction(){ + let firstName = "John" + let lastName = "Doe" + let fullName = firstName + lastName //scoping: ( global , override) + + console.log(fullName) + + +} + + + +/* +javascript is dynamically packed language +don't have to define like other languages, ex just put 5 + + +String +Number + int + dec -decimal + float -many decimals, more specific + +variable types: (fixed) +var + var x = 5 + var x = 10, fixed now x i 10 + +CONT + constant at the top, unchange + +let + work in certain scope, like in a loop + only works inside loop AND NOT outside loop + Ex. let x = 5 + dont have to re delare, re define + +Operators + + , - , * , / basic math operator + ++ incremental operators, increment by 1 + -- de-increment by 1 + = assign value + == it has the same value, compare + === same value and same type + + + + + + + + +*/ \ No newline at end of file