Skip to content
This repository was archived by the owner on Jan 14, 2024. It is now read-only.

LONDON-9-SAGHAR HOSSEINMARDI-JS-WEEK3 - #201

Open
SagharHosseinmardi wants to merge 4 commits into
CodeYourFuture:mainfrom
SagharHosseinmardi:main
Open

LONDON-9-SAGHAR HOSSEINMARDI-JS-WEEK3#201
SagharHosseinmardi wants to merge 4 commits into
CodeYourFuture:mainfrom
SagharHosseinmardi:main

Conversation

@SagharHosseinmardi

Copy link
Copy Markdown

No description provided.

@jonnywyatt jonnywyatt left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Brilliant Saghar!
When rendering a string with embedded variables, have a look at template strings and see if you prefer the syntax (or not)

let hello = sayHello();
console.log(hello);

// the function doesn't return anything and there is no value to be assigned to it

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

👍

let arr = [1,2,3];
let arr = [1, 2, 3];
console.log(arr[3]);
// the index in console.log does not exist in an array

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Yes, the array has only 3 items so arr[3] is referencing an item that doesn't exist

n--;
}

console.log(arr);

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

This logs out the array fine, looks good.
It's a minor point but the instruction is asking to log it out as a comma-separated string. Have a look at the array.join method.


function evenNumbersSum(n) {
// TODO
let number = 0;

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Great 👍

// TODO - Write for loop code here

for (let i = 0; i < WRITERS.length; i++) {
console.log(WRITERS[i] + " is " + AGES[i] + " years old");

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Perfect

Comment thread 2-mandatory/1-weather-report.js Outdated

function getTemperatureReport(cities) {
// TODO
return cities.map(

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

You'll use map a lot in the future, so great that you've got it so quickly

@jonnywyatt jonnywyatt added the reviewed A mentor has reviewed this code label Dec 10, 2022
@Roozbehshokri1990

Copy link
Copy Markdown

perfect code,nice

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

Labels

reviewed A mentor has reviewed this code

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants