Skip to content

Homework 6#5

Open
Phantom123-cloud wants to merge 19 commits into
masterfrom
homework-6
Open

Homework 6#5
Phantom123-cloud wants to merge 19 commits into
masterfrom
homework-6

Conversation

@Phantom123-cloud
Copy link
Copy Markdown
Owner

No description provided.

Comment thread 06/script.js Outdated

// Destructure

const spanTxt = obj.children[0].children[0].children[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.

use destructure here

Comment thread 06/script.js Outdated

{
// Destruct array
let arr = [1, 2, 3, 4, 5, "a", "b", "c"]
Copy link
Copy Markdown

Choose a reason for hiding this comment

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

const

Comment thread 06/script.js Outdated

{
// Destruct 2
let obj = {
Copy link
Copy Markdown

Choose a reason for hiding this comment

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

const

Comment thread 06/script.js Outdated

const result = (parseFloat(data.rates[currencyConversion]) / parseFloat(data.rates[inputCurrency])) * parseFloat(sumInputCurrency);

console.log(`вхідна валюта: ${inputCurrency} ${(data.rates[inputCurrency]).toFixed(2)} / сумма ${sumInputCurrency}; валюта для конвертації: ${currencyConversion} ${(data.rates[currencyConversion]).toFixed(2)}/ сумма ${result.toFixed(2)}`);
Copy link
Copy Markdown

Choose a reason for hiding this comment

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

typo: сумма => сума

Comment thread 06/script.js Outdated

const result = (parseFloat(data.rates[currencyConversion]) / parseFloat(data.rates[inputCurrency])) * parseFloat(sumInputCurrency);

console.log(`вхідна валюта: ${inputCurrency} ${(data.rates[inputCurrency]).toFixed(2)} / сумма ${sumInputCurrency}; валюта для конвертації: ${currencyConversion} ${(data.rates[currencyConversion]).toFixed(2)}/ сумма ${result.toFixed(2)}`);
Copy link
Copy Markdown

Choose a reason for hiding this comment

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

no log rule

Comment thread 06/script.js Outdated
let currencyConversion = prompt('введіть валюту, в яку відбувається конвертація');
let sumInputCurrency = prompt('введіть суму у вхідній валюті');

const result = (parseFloat(data.rates[currencyConversion]) / parseFloat(data.rates[inputCurrency])) * parseFloat(sumInputCurrency);
Copy link
Copy Markdown

Choose a reason for hiding this comment

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

I suggest splitting this line

Comment thread 06/script.js
fetch('https://open.er-api.com/v6/latest/USD')
.then(res => res.json())
.then(data => {
for (const [currency, rate] of Object.entries(data.rates)) {
Copy link
Copy Markdown

Choose a reason for hiding this comment

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

👍

Comment thread 06/script.js

Object.keys(car).map((key) => {
const label = document.createElement('label');
const input = document.createElement('input');
Copy link
Copy Markdown

Choose a reason for hiding this comment

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

wrap input in label or add for attr

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