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

NW-6 | Zeliha Pala | JS2 | [TECH ED] exercises | WEEK-2 #153

Open
wants to merge 8 commits into
base: main
Choose a base branch
from

Conversation

zelihapala
Copy link

@zelihapala zelihapala commented Dec 28, 2023

Learners, PR Template

Self checklist

  • I have committed my files one by one, on purpose, and for a reason
  • I have titled my PR with COHORT_NAME | FIRST_NAME LAST_NAME | REPO_NAME | WEEK
  • I have tested my changes
  • My changes follow the style guide
  • My changes meet the requirements of this task

Changelist

Briefly explain your PR.

Questions

Ask any questions you have for your reviewer.

Copy link

netlify bot commented Dec 28, 2023

Deploy Preview for cute-gaufre-e4b4e5 ready!

Name Link
🔨 Latest commit 40659a8
🔍 Latest deploy log https://app.netlify.com/sites/cute-gaufre-e4b4e5/deploys/65a1eea9a66cdd000829b9fe
😎 Deploy Preview https://deploy-preview-153--cute-gaufre-e4b4e5.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.

To edit notification comments on pull requests, go to your Netlify site configuration.

@zelihapala
Copy link
Author

not finished yet

Copy link
Contributor

@pseudopilot pseudopilot left a comment

Choose a reason for hiding this comment

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

@zelihapala , this is really awesome work!
I'm impressed with every your explanation and implementation. And especially 🥇 for stretch block.
Though, it seems to me that Interpret block is missing from this week module. If so would you please add it? I'm sure it won't take much time for you!

Comment on lines +15 to +17
console.log(`My house number is ${address.houseNumber}`);
//or
console.log(`My house number is ${address[`houseNumber`]}`);
Copy link
Contributor

Choose a reason for hiding this comment

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

I'm sure this solution would be enough 👍

Comment on lines +16 to +28
// To access the values within an object, we can use various methods like Object.values(), Object.keys(), or Object.entries().

for (const value of Object.values(author)) {
console.log(value);
}

// or
for (const key of Object.keys(author)) {
console.log(author[key]);
}

// or
for (const [key, value] of Object.entries(author)) {
Copy link
Contributor

Choose a reason for hiding this comment

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

Awesome knowledge of Object methods and iteration approaches!

Comment on lines +9 to +10
for (let i = 0; i < listOfItems.length; i++) {
let eachItem = listOfItems[i];
Copy link
Contributor

Choose a reason for hiding this comment

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

It's absolutely correct and works perfect! But just a question: do you really need a for loop here? Do you really need the indexes? Can you achieve the same result with for ... of loop?

Comment on lines +37 to +43
for (const word of words) {
if (wordCount[word]) {
wordCount[word]++;
} else {
wordCount[word] = 1;
}
}
Copy link
Contributor

Choose a reason for hiding this comment

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

Ah, here you go, using for ... of loop. Great!


for (const [coin, quantity] of Object.entries(till)) {
console.log(coin * quantity);
total += coin * quantity;
const numericValue = parseFloat(coin.replace(/[^\d.]/g, ""));
Copy link
Contributor

Choose a reason for hiding this comment

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

I think we can even parseFloat without replacing non numeric characters 🤔

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