From ce4b32616677cee845174a9557a75adbdf3e659b Mon Sep 17 00:00:00 2001 From: seghiivus Date: Fri, 18 Nov 2022 23:01:18 +0200 Subject: [PATCH 1/4] 1-basics --- .../1-basics/basics.js | 106 ++++++++++++++++++ 1 file changed, 106 insertions(+) create mode 100644 homeworks/serhii.usanin_serhiivus/1-basics/basics.js diff --git a/homeworks/serhii.usanin_serhiivus/1-basics/basics.js b/homeworks/serhii.usanin_serhiivus/1-basics/basics.js new file mode 100644 index 00000000..938fc9c7 --- /dev/null +++ b/homeworks/serhii.usanin_serhiivus/1-basics/basics.js @@ -0,0 +1,106 @@ +const firstNumber = 15; +const secondNumber = 17; + +var sum = firstNumber + secondNumber; +console.log( + "First number = ", + firstNumber, + " Second number =", + secondNumber, + " Sum = ", + sum, + typeof sum +); + +var difference = firstNumber - secondNumber; +console.log( + "First number = ", + firstNumber, + " Second number =", + secondNumber, + " Difference = ", + difference, + typeof difference +); + +var product = firstNumber * secondNumber; +console.log( + "First number = ", + firstNumber, + " Second number =", + secondNumber, + " Product = ", + product, + typeof product +); + +var fraction = firstNumber / secondNumber; +console.log( + "First number = ", + firstNumber, + " Second number =", + secondNumber, + " Fraction = ", + fraction, + typeof fraction +); + +var renOfDivision = firstNumber % secondNumber; +console.log( + "First number = ", + firstNumber, + " Second number =", + secondNumber, + " Remainder of division = ", + renOfDivision, + typeof renOfDivision +); + +const degree = 3; +var expFirst = firstNumber ** degree; +console.log( + "First number = ", + firstNumber, + " Degree =", + degree, + " Exponentiate = ", + expFirst, + typeof expFirst +); + +var divByZero = firstNumber / 0; +console.log( + "First number = ", + firstNumber, + + " Division by zero = ", + divByZero, + typeof divByZero +); + +var divByString = firstNumber / "ss"; +console.log( + "First number = ", + firstNumber, + + " Division by string = ", + divByString, + typeof divByString +); + +var undef; +console.log(" Undefinded = ", undef, typeof undef); + +var exampNull = null; +console.log(" null = ", exampNull, typeof exampNull); + +const firstString = "Hello "; +const secondString = "world "; + +let concat = firstString + secondString; +console.log(" Concat = ", concat, typeof concat); + +let diff = firstString - secondString; +console.log(" diff = ", diff, typeof diff); + +console.log("undef:", typeof kjf) \ No newline at end of file From 218cb7e8fff70776711eced09f77c067f46052c1 Mon Sep 17 00:00:00 2001 From: seghiivus Date: Fri, 18 Nov 2022 23:50:27 +0200 Subject: [PATCH 2/4] 1-basics_2 --- .../1-basics/basics.js | 135 ++++++------------ 1 file changed, 45 insertions(+), 90 deletions(-) diff --git a/homeworks/serhii.usanin_serhiivus/1-basics/basics.js b/homeworks/serhii.usanin_serhiivus/1-basics/basics.js index 938fc9c7..0996f87e 100644 --- a/homeworks/serhii.usanin_serhiivus/1-basics/basics.js +++ b/homeworks/serhii.usanin_serhiivus/1-basics/basics.js @@ -1,106 +1,61 @@ const firstNumber = 15; const secondNumber = 17; +const degree = 3; +const firstString = 'Hello '; +const secondString = 'world '; -var sum = firstNumber + secondNumber; -console.log( - "First number = ", - firstNumber, - " Second number =", - secondNumber, - " Sum = ", - sum, - typeof sum -); - -var difference = firstNumber - secondNumber; -console.log( - "First number = ", - firstNumber, - " Second number =", - secondNumber, - " Difference = ", - difference, - typeof difference -); - -var product = firstNumber * secondNumber; -console.log( - "First number = ", - firstNumber, - " Second number =", - secondNumber, - " Product = ", - product, - typeof product -); +let sum; +let difference; +let product; +let fraction; +let renOfDivision; +let expFirst; +let divByZero; +let divByString; +let undef; +let exampNull; +let concat; +let diffString; -var fraction = firstNumber / secondNumber; -console.log( - "First number = ", - firstNumber, - " Second number =", - secondNumber, - " Fraction = ", - fraction, - typeof fraction -); +sum = firstNumber + secondNumber; +console.log('First number = ', firstNumber, +' Second number =', secondNumber,' Sum = ', sum, typeof sum); -var renOfDivision = firstNumber % secondNumber; -console.log( - "First number = ", - firstNumber, - " Second number =", - secondNumber, - " Remainder of division = ", - renOfDivision, - typeof renOfDivision -); +difference = firstNumber - secondNumber; +console.log('First number = ', firstNumber, +' Second number =', secondNumber, ' Difference = ', difference, typeof difference); -const degree = 3; -var expFirst = firstNumber ** degree; -console.log( - "First number = ", - firstNumber, - " Degree =", - degree, - " Exponentiate = ", - expFirst, - typeof expFirst -); +product = firstNumber * secondNumber; +console.log('First number = ', firstNumber, +' Second number =', secondNumber,' Product = ', product, typeof product); -var divByZero = firstNumber / 0; -console.log( - "First number = ", - firstNumber, +fraction = firstNumber / secondNumber; +console.log('First number = ', firstNumber, +' Second number =', secondNumber, ' Fraction = ', fraction, typeof fraction); - " Division by zero = ", - divByZero, - typeof divByZero -); +renOfDivision = firstNumber % secondNumber; +console.log('First number = ', firstNumber, +' Second number =', secondNumber, ' Remainder of division = ', renOfDivision, typeof renOfDivision); -var divByString = firstNumber / "ss"; -console.log( - "First number = ", - firstNumber, +expFirst = firstNumber ** degree; +console.log('First number = ', firstNumber, +' Degree =', degree, ' Exponentiate = ', expFirst, typeof expFirst); - " Division by string = ", - divByString, - typeof divByString -); +divByZero = firstNumber / 0; +console.log('First number = ', firstNumber, ' Division by zero = ', divByZero, typeof divByZero); -var undef; -console.log(" Undefinded = ", undef, typeof undef); +divByString = firstNumber / 'ss'; +console.log('First number = ', firstNumber, ' Division by string = ', divByString, typeof divByString); -var exampNull = null; -console.log(" null = ", exampNull, typeof exampNull); +console.log(' Undefinded = ', undef, typeof undef); -const firstString = "Hello "; -const secondString = "world "; +exampNull = null; +console.log(' null = ', exampNull, typeof exampNull); -let concat = firstString + secondString; -console.log(" Concat = ", concat, typeof concat); +concat = firstString + secondString; +console.log(' Concat = ', concat, typeof concat); -let diff = firstString - secondString; -console.log(" diff = ", diff, typeof diff); +diffString = firstString - secondString; +console.log(' diff = ', diffString, typeof diffString); -console.log("undef:", typeof kjf) \ No newline at end of file +console.log('undef:', typeof kjf); From 9f573c0829dc6e61646677b28af3390a98f76d31 Mon Sep 17 00:00:00 2001 From: seghiivus Date: Sat, 19 Nov 2022 00:16:32 +0200 Subject: [PATCH 3/4] 1-basics_3 --- .../1-basics/basics.js | 38 +++++++++---------- 1 file changed, 17 insertions(+), 21 deletions(-) diff --git a/homeworks/serhii.usanin_serhiivus/1-basics/basics.js b/homeworks/serhii.usanin_serhiivus/1-basics/basics.js index 0996f87e..59e2421f 100644 --- a/homeworks/serhii.usanin_serhiivus/1-basics/basics.js +++ b/homeworks/serhii.usanin_serhiivus/1-basics/basics.js @@ -4,42 +4,41 @@ const degree = 3; const firstString = 'Hello '; const secondString = 'world '; -let sum; -let difference; -let product; -let fraction; -let renOfDivision; -let expFirst; -let divByZero; -let divByString; -let undef; -let exampNull; -let concat; -let diffString; +let sum = 0; +let difference = 0; +let product = 0; +let fraction = 0; +let renOfDivision = 0; +let expFirst = 0; +let divByZero = 0; +let divByString = 0; +const exampNull = null; +let concat = ''; +let diffString = ''; sum = firstNumber + secondNumber; console.log('First number = ', firstNumber, -' Second number =', secondNumber,' Sum = ', sum, typeof sum); + ' Second number =', secondNumber, ' Sum = ', sum, typeof sum); difference = firstNumber - secondNumber; console.log('First number = ', firstNumber, -' Second number =', secondNumber, ' Difference = ', difference, typeof difference); + ' Second number =', secondNumber, ' Difference = ', difference, typeof difference); product = firstNumber * secondNumber; console.log('First number = ', firstNumber, -' Second number =', secondNumber,' Product = ', product, typeof product); + ' Second number =', secondNumber, ' Product = ', product, typeof product); fraction = firstNumber / secondNumber; console.log('First number = ', firstNumber, -' Second number =', secondNumber, ' Fraction = ', fraction, typeof fraction); + ' Second number =', secondNumber, ' Fraction = ', fraction, typeof fraction); renOfDivision = firstNumber % secondNumber; console.log('First number = ', firstNumber, -' Second number =', secondNumber, ' Remainder of division = ', renOfDivision, typeof renOfDivision); + ' Second number =', secondNumber, ' Remainder of division = ', renOfDivision, typeof renOfDivision); expFirst = firstNumber ** degree; console.log('First number = ', firstNumber, -' Degree =', degree, ' Exponentiate = ', expFirst, typeof expFirst); + ' Degree =', degree, ' Exponentiate = ', expFirst, typeof expFirst); divByZero = firstNumber / 0; console.log('First number = ', firstNumber, ' Division by zero = ', divByZero, typeof divByZero); @@ -47,9 +46,6 @@ console.log('First number = ', firstNumber, ' Division by zero = ', divByZero, t divByString = firstNumber / 'ss'; console.log('First number = ', firstNumber, ' Division by string = ', divByString, typeof divByString); -console.log(' Undefinded = ', undef, typeof undef); - -exampNull = null; console.log(' null = ', exampNull, typeof exampNull); concat = firstString + secondString; From a7a2ed8d12713aa4295dfad304ec5ae51584754d Mon Sep 17 00:00:00 2001 From: seghiivus Date: Sat, 19 Nov 2022 00:20:07 +0200 Subject: [PATCH 4/4] 1-basics_4 --- homeworks/serhii.usanin_serhiivus/1-basics/basics.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/homeworks/serhii.usanin_serhiivus/1-basics/basics.js b/homeworks/serhii.usanin_serhiivus/1-basics/basics.js index 59e2421f..3773b290 100644 --- a/homeworks/serhii.usanin_serhiivus/1-basics/basics.js +++ b/homeworks/serhii.usanin_serhiivus/1-basics/basics.js @@ -44,7 +44,7 @@ divByZero = firstNumber / 0; console.log('First number = ', firstNumber, ' Division by zero = ', divByZero, typeof divByZero); divByString = firstNumber / 'ss'; -console.log('First number = ', firstNumber, ' Division by string = ', divByString, typeof divByString); +console.log('First number = ', firstNumber, ' Division by string = ', divByString, typeof divByString); console.log(' null = ', exampNull, typeof exampNull);