Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

1-basics #99

Merged
merged 4 commits into from
Nov 19, 2022
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
57 changes: 57 additions & 0 deletions homeworks/serhii.usanin_serhiivus/1-basics/basics.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,57 @@
const firstNumber = 15;
const secondNumber = 17;
const degree = 3;
const firstString = 'Hello ';
const secondString = 'world ';

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);

difference = firstNumber - secondNumber;
console.log('First number = ', firstNumber,
' Second number =', secondNumber, ' Difference = ', difference, typeof difference);

product = firstNumber * secondNumber;
console.log('First number = ', firstNumber,
' Second number =', secondNumber, ' Product = ', product, typeof product);

fraction = firstNumber / secondNumber;
console.log('First number = ', firstNumber,
' Second number =', secondNumber, ' Fraction = ', fraction, typeof fraction);

renOfDivision = firstNumber % secondNumber;
console.log('First number = ', firstNumber,
' Second number =', secondNumber, ' Remainder of division = ', renOfDivision, typeof renOfDivision);

expFirst = firstNumber ** degree;
console.log('First number = ', firstNumber,
' Degree =', degree, ' Exponentiate = ', expFirst, typeof expFirst);

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(' null = ', exampNull, typeof exampNull);

concat = firstString + secondString;
console.log(' Concat = ', concat, typeof concat);

diffString = firstString - secondString;
console.log(' diff = ', diffString, typeof diffString);

console.log('undef:', typeof kjf);