Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Methods of primitives#10

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 ourterms of service andprivacy statement. We’ll occasionally send you account related emails.

Already on GitHub?Sign in to your account

Merged
tarasyyyk merged 7 commits intojavascript-tutorial:masterfromstevermeister:translation
May 9, 2019
Merged

Methods of primitives#10

tarasyyyk merged 7 commits intojavascript-tutorial:masterfromstevermeister:translation
May 9, 2019

Conversation

stevermeister
Copy link
Contributor

No description provided.

@CLAassistant
Copy link

CLAassistant commentedMay 8, 2019
edited
Loading

CLA assistant check
All committers have signed the CLA.

Copy link
Collaborator

@tarasyyyktarasyyyk left a comment

Choose a reason for hiding this comment

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

@stevermeister you did a great work. I found some small remarks which need to be resolved before merging.

@@ -1,22 +1,22 @@
# Methods of primitives
Copy link
Collaborator

Choose a reason for hiding this comment

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

Article title not translated


- Is a value of a primitive type.
- There are 6 primitive types: `string`, `number`, `boolean`, `symbol`, `null` and `undefined`.
- є Is a value of a primitive type.
Copy link
Collaborator

Choose a reason for hiding this comment

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

Remove this line "Is a value of a primitive type."


З іншого боку, використання тих же самих функцій `String / Number / Boolean` без` new` є абсолютно розумною і корисною річчю. Вони перетворюють значення у відповідний тип: до рядка, числа або булевого (примітиву).

Наприклад, це цілком справедливо:
For example, this is entirely valid:
Copy link
Collaborator

Choose a reason for hiding this comment

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

Remove "For example, this is entirely valid:"

Copy link
ContributorAuthor

Choose a reason for hiding this comment

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

was not sure about good translation in this place, maybe you have ideas?

Copy link
Collaborator

Choose a reason for hiding this comment

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

"Наприклад, такий вираз цілком правильний:"
or
"Наприклад, це/так цілком правильно:"

stevermeister reacted with thumbs up emoji

З іншого боку, використання тих же самих функцій `String / Number / Boolean` без` new` є абсолютно розумною і корисною річчю. Вони перетворюють значення у відповідний тип: до рядка, числа або булевого (примітиву).

Наприклад, це цілком справедливо:
For example, this is entirely valid:
```js
let num = Number("123"); // convert a string to number
Copy link
Collaborator

Choose a reason for hiding this comment

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

Comment also can be translated


```js run
alert(null.test); // error
````

##Summary
##Виводи
Copy link
Collaborator

Choose a reason for hiding this comment

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

It's better to translate "Summary" as "Висновки" or "Підсумки"

stevermeister reacted with thumbs up emoji

З іншого боку, використання тих же самих функцій `String / Number / Boolean` без` new` є абсолютно розумною і корисною річчю. Вони перетворюють значення у відповідний тип: до рядка, числа або булевого (примітиву).

Наприклад, це цілком справедливо:
For example, this is entirely valid:
Copy link
Collaborator

Choose a reason for hiding this comment

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

"Наприклад, такий вираз цілком правильний:"
or
"Наприклад, це/так цілком правильно:"

stevermeister reacted with thumbs up emoji
@@ -126,7 +126,7 @@ let num = Number("123"); // convert a string to number
alert(null.test); // error
Copy link
Collaborator

Choose a reason for hiding this comment

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

translate comment: // помилка

@@ -1,5 +1,5 @@

Try running it:
Спробуйте запустити:

```js run
let str = "Hello";
Copy link
Collaborator

Choose a reason for hiding this comment

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

let str = "Привіт";

1. `undefined`
2.An error.
2.помилка.
Copy link
Collaborator

Choose a reason for hiding this comment

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

  1. помилку.



Consider the following code:
Розглянемо наступний код:

```js
let str = "Hello";
Copy link
Collaborator

Choose a reason for hiding this comment

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

let str = "Привіт";


Objects are "heavier" than primitives. They require additional resources to support the internal machinery. But as properties and methods are very useful in programming,JavaScriptengines try to optimize them to reduce the additional burden.
Об'єкти "важче", ніж примітиви. Вони вимагають додаткових ресурсів для підтримки внутрішньої обробки. Але, оскільки властивості і методи дуже корисні в програмуванні, двигунJavaScriptнамагається оптимізувати їх для зменшення додаткового навантаження.
Copy link
Collaborator

Choose a reason for hiding this comment

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

Об'єкти "важчі" за примітиви.


Here's how it works:
Ось як він працює:

```js run
let str = "Hello";
Copy link
Collaborator

Choose a reason for hiding this comment

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

let str = "Привіт";
...
// ПРИВІТ

1. The string `str` is a primitive. So in the moment of accessing its property, a special object is created that knows the value of the string, and has useful methods, like `toUpperCase()`.
2. That method runs and returns a new string (shown by `alert`).
3. The special object is destroyed, leaving the primitive `str` alone.
1. Рядок `str` є примітивом. Тому під час звернення до його властивості створюється спеціальний об'єкт, який знає значення рядка і має корисні методи, такі як `toUpperCase ()`.
Copy link
Collaborator

Choose a reason for hiding this comment

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

toUpperCase() - without space


```js run
let zero = new Number(0);

if (zero) { // zerois true,because it's an object
if (zero) { // zeroє true,тому що це об'єкт
alert( "zero is truthy?!?" );
Copy link
Collaborator

Choose a reason for hiding this comment

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

alert( "чи zero є true?!?" );


З іншого боку, використання тих же самих функцій `String / Number / Boolean` без` new` є абсолютно розумною і корисною річчю. Вони перетворюють значення у відповідний тип: до рядка, числа або булевого (примітиву).
Copy link
Collaborator

Choose a reason for hiding this comment

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

remove space before new

@stevermeister
Copy link
ContributorAuthor

@tarasyyyk thank you for detailed review! all places were updated accordingly to the comments

@tarasyyyktarasyyyk merged commit96163a4 intojavascript-tutorial:masterMay 9, 2019
@tarasyyyk
Copy link
Collaborator

@stevermeister found some fresh changes to English version:
javascript-tutorial/en.javascript.info@1ba420f
Would be good to translate them as well.

@stevermeister
Copy link
ContributorAuthor

stevermeister commentedMay 9, 2019
edited
Loading

@tarasyyyk yes, sure
here you are
https://github.com/javascript-tutorial/uk.javascript.info/pull/11/files

and could you please update untranslated parts of this repo with actual en origin?

javascript-translate-bot pushed a commit that referenced this pull requestNov 11, 2019
Adding some mention of implicit `<tbody>` element. Comes up later in Modifying the Document task#10 solution.
@tarasyyyk
Copy link
Collaborator

Thanks for your contribution!
@all-contributors add@stevermeister for translation.

@allcontributors
Copy link
Contributor

@tarasyyyk

I've put upa pull request to add@stevermeister! 🎉

@tarasyyyktarasyyyk changed the titleData types > Methods of primitivesMethods of primitivesAug 29, 2024
Sign up for freeto join this conversation on GitHub. Already have an account?Sign in to comment
Reviewers

@tarasyyyktarasyyyktarasyyyk left review comments

Assignees
No one assigned
Labels
None yet
Projects
None yet
Milestone
No milestone
Development

Successfully merging this pull request may close these issues.

3 participants
@stevermeister@CLAassistant@tarasyyyk

[8]ページ先頭

©2009-2025 Movatter.jp