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

Main #398

Open
wants to merge 5 commits into
base: master
Choose a base branch
from
Open

Main #398

Show file tree
Hide file tree
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
1 change: 1 addition & 0 deletions 01-Fundamentals-Part-1/starter/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -25,5 +25,6 @@
</head>
<body>
<h1>JavaScript Fundamentals – Part 1</h1>
<script src="script.js"></script>
</body>
</html>
67 changes: 67 additions & 0 deletions 01-Fundamentals-Part-1/starter/script.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,67 @@
// const inputYear = '1991';
// console.log(Number(inputYear), inputYear);
// console.log(Number(inputYear) + 18 + " Poo");
// console.log(Number('Jonas'));
// console.log(typeof NaN);
// console.log(String(23),23);
// type coercion
// console.log('I am ' + 23 + ' years old');
// console.log('i am ' + String(23) + ' years old');
// console.log('23' - '10' - 3);
// console.log('23' * '2');

// let n = '1' + 1;
// n=n-1;
// console.log(n);

// 5 falsy values: 0, '', undefined, null, NaN

// console.log(Boolean(0));
// console.log(Boolean(undefined));
// console.log(Boolean('Jonas'));
// console.log(Boolean({}));

// const money = 100;
// if (money) {
// console.log("Don't spend it all ;)");
// }else{
// console.log('You should get a job!')
// }

// let height = 10;
// if(height) {
// console.log("YAY! Height is defined");
// }else{
// console.log('Not defined');
// }

// const age = '18';
// if(age === 18) console.log('Yes (strict)');
// if(age == 18) console.log('Yes (loose)');

// const favorite = Number(prompt("??"));
// console.log(favorite);
// console.log(typeof favorite);

// if (favorite === 23) {
// console.log('👌👌');
// }else if (favorite === 7){
// console.log('👍🙌')
// }else{
// console.log('NO')
// }

const hasDriversLicense = true; //A
const hasGoodVision = true; //B

console.log(hasDriversLicense && hasGoodVision);
console.log(!hasDriversLicense || hasGoodVision);
console.log(!hasDriversLicense);

const shouldDrive = hasDriversLicense && hasGoodVision

if(shouldDrive){
console.log('Sarah is able to drive!')
}else{
console.log('Someone else should drive.')
}
2 changes: 1 addition & 1 deletion 10-Functions/final/script.js
Original file line number Diff line number Diff line change
Expand Up @@ -88,7 +88,7 @@ const transformer = function (str, fn) {
transformer('JavaScript is the best!', upperFirstWord);
transformer('JavaScript is the best!', oneWord);

// JS uses callbacks all the time
//JS uses callbacks all the time
const high5 = function () {
console.log('👋');
};
Expand Down
Loading