Skip to content
Open
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
54 changes: 54 additions & 0 deletions 01week/datatypes.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,54 @@
const day = date.getDay();
const hour = date.getHours();
const minute = date.getMinutes();
console.log("today is " + [day] + " " + [hour] + ":" + [minute]);

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

this needs to be a function that returns today's date



const number = (x) => {
console.log(toString(x));

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

return, don't console log

}
number("84");


const string = (number) => {
console.log(Number(number));

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

return, don't console log

}
string(48);


const type = (datatype) => {
console.log(typeof datatype);

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

return, don't console log

}
type(false);


const add = (x, y) => {
console.log (x + y);

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

return, don't console log

}
add(4,6);


const a = 6;
const b = 9;
const c = 12;

function twoTrue() {
if (b>a && c>b) {

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This function evaluates if 9 is greater than 6 and if 12 is greater than 9. I need a function that takes in ANY two arguments and evaluates if they're both truthy.

console.log(a+b);
}
}
twoTrue();

const oneTrue = (x,y) => {
if (x>y || x==y) {

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This function evaluates if x is greater than y or if x is equal to y. I need a function that evaluates if x is truthy or if y is truthy.

console.log(x+y);
}
}
oneTrue(3,1);

const noneTrue = (x,y) => {
if (!x>y && !x==y) {

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This function evaluates if x is less than y or if x is not equal to y. I need a function that evaluates if both x and y are falsy

console.log(x+y);
}
}
noneTrue(1,3);