Skip to content

Conversation

@hamzakoc
Copy link

No description provided.

Copy link
Collaborator

@epq epq left a comment

Choose a reason for hiding this comment

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

I left a few comments. Overall, good work 👍


//3.Declare a variable age and initialize it with an integer, using these exact steps:
let x;
console.log('the value of age will be: 30');
Copy link
Collaborator

Choose a reason for hiding this comment

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

After you ran your program, do you understand why x isn't 30 when you first declared it on line 12?

//4.Declare a variable name and assign a string to it.

let y ='butterfly';
console.log('the value of my string will be:bird');
Copy link
Collaborator

Choose a reason for hiding this comment

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

Maybe you made a typo, but the value of y isn't bird here.

let roundedNumber=Math.round(number);
console.log(number); // prints 7

if(roundedNumber < number){
Copy link
Collaborator

Choose a reason for hiding this comment

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

Good work here, but make sure you declare your variable result with the let keyword, i.e. let result;. Otherwise, it'll automatically become a global variable (https://www.w3schools.com/js/js_scope.asp)

console.log(myString.length);


//8.If x equals 7, and the only other statement is x = x % 3, what would be the new value of x?
Copy link
Collaborator

Choose a reason for hiding this comment

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

Good job with the examples here!

console.log(counter + 2);


counter=+2;
Copy link
Collaborator

Choose a reason for hiding this comment

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

counter = +2 actually assigns the value of the counter to 2. The third method would be to write this out twice:
counter++;
counter++;

//6.Arrays

let colors=[];
console.log('the value of my array is: blue, yellow, green, black');
Copy link
Collaborator

Choose a reason for hiding this comment

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

Did you forget to add some colors to your array?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants