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

Lesson 7: type script #6

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open

Lesson 7: type script #6

wants to merge 1 commit into from

Conversation

DenisKozachok
Copy link
Owner

No description provided.

Copy link

@vlevkoniuk vlevkoniuk left a comment

Choose a reason for hiding this comment

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

зауваження написані в коменті
Додатково
Не правильно мейнтейниться моно репозиорій
В кожного проекту буде має бути свій package.json, свій лінтер конфіг і інші конфіги
Не працює у тебе лінтер із-за неправильної структури репо

Comment on lines +6 to +7
const numberArray2: number[] = [1, 2, 3, 4];
const stringArray2: string[] = ["10", "20", "30"];

Choose a reason for hiding this comment

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

явна vs неявна типізація. В даному випадку при ініціалізації змінної ТС знає кий тип буде у змінній


// Виклики стрілочної функції та виведення результатів
console.log("Sum of numberArray2 =", sumArrayArrow(numberArray2)); // 10
console.log("Sum of stringArray2 =", sumArrayArrow(stringArray2)); // 60

Choose a reason for hiding this comment

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

функція написана так, що є баг, та з назви функція я очікую, що вона складатиме стрінги як стрінги, а не каститиме це у намбери

const stringArray2 = ["10", "20", "30", 'type'];
console.log("Sum of stringArray2 =", sumArrayArrow(stringArray2));  // NaN

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