GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Sign in
  • ActionsCI/CD and automation
  • CodespacesCloud development environments
  • All Features
  • Documentation
  • Training
  • Certifications
  • Build with Copilot
  • Customize Copilot
  • Integrations
  • Trending repos
  • GitHub Sponsors
  • Developer articles
  • Enterprises

This view

  • Original page
  • New address

GeezerVison is showing github.com — Functions by marina-t-itf · Pull Request #169 · javascript-tutorial/ro.javascript.info

Conversation

@marina-t-itf

@marina-t-itf marina-t-itf commented Jan 18, 2023

Copy link
Copy Markdown

No description provided.

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

All reactions
@marina-t-itf
Functions
f114998
@javascript-translate-bot javascript-translate-bot added the review needed label Jan 18, 2023
@javascript-translate-bot
javascript-translate-bot requested a review from a team January 18, 2023 16:39
@javascript-translate-bot javascript-translate-bot mentioned this pull request Jan 18, 2023
Romanian Translation Progress #1
Open
@CLAassistant

CLAassistant commented Jan 18, 2023 •
edited
Loading

Uh oh!

There was an error while loading. Please reload this page.

Copy link
Copy Markdown

CLA assistant check
Thank you for your submission! We really appreciate it. Like many open source projects, we ask that you all sign our Contributor License Agreement before we can accept your contribution.
2 out of 3 committers have signed the CLA.

✅ marina-t-itf
✅ bogdanbacosca
❌ MarinaG


MarinaG seems not to be a GitHub user. You need a GitHub account to be able to sign the CLA. If you have already a GitHub account, please add the email address used for this commit to your account.
You have signed the CLA already but the status is still pending? Let us recheck it.

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

bogdanbacosca
bogdanbacosca requested changes Jan 20, 2023
View reviewed changes

@bogdanbacosca bogdanbacosca left a comment

Copy link
Copy Markdown
Contributor

There was a problem hiding this comment.

Choose a reason for hiding this comment

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

Mai sunt câteva schimbări minore care trebuiesc implementate.

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

All reactions
Comment thread 1-js/02-first-steps/15-function-basics/1-if-else-required/task.md Resolved

Uh oh!

There was an error while loading. Please reload this page.

Comment thread 1-js/02-first-steps/15-function-basics/2-rewrite-function-question-or/task.md Outdated
Următoarea funcție returnează `true` dacă parametrul `age` este mai mare decât `18`.

Otherwise it asks for a confirmation and returns its result.
În caz contrar, solicită o confirmare și returnează rezultatul.

@bogdanbacosca bogdanbacosca Jan 20, 2023

Copy link
Copy Markdown
Contributor

There was a problem hiding this comment.

Choose a reason for hiding this comment

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

Suggested change
În caz contrar, solicită o confirmare și returnează rezultatul.
În caz contrar aceasta cere o confirmare și îi returnează rezultatul.

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

All reactions
Comment thread 1-js/02-first-steps/15-function-basics/4-pow/solution.md Outdated

if (n < 1) {
alert(`Power ${n} is not supported, use a positive integer`);
alert(`Puterea ${n} nu este acceptată, utilizați un număr întreg pozitiv`);

@bogdanbacosca bogdanbacosca Jan 20, 2023

Copy link
Copy Markdown
Contributor

There was a problem hiding this comment.

Choose a reason for hiding this comment

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

Am putea folosi susținut pentru a traduce supported peste tot -- pentru consisteță.

Suggested change
alert(`Puterea ${n} nu este acceptată, utilizați un număr întreg pozitiv`);
alert(`Puterea ${n} nu este susținută, utilizați un număr întreg pozitiv`);

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

All reactions
Comment thread 1-js/02-first-steps/15-function-basics/article.md Outdated
# Funcții

Quite often we need to perform a similar action in many places of the script.
Destul de des avem nevoie să realizăm o acțiune similară în multe locuri ale secvenței de instrucțiuni.

@bogdanbacosca bogdanbacosca Jan 20, 2023

Copy link
Copy Markdown
Contributor

There was a problem hiding this comment.

Choose a reason for hiding this comment

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

În unele cazuri, putem să nu traducem termenii tehnici dacă nu există o conveție bine definită în limba română.

Suggested change
Destul de des avem nevoie să realizăm o acțiune similară în multe locuri ale secvenței de instrucțiuni.
Destul de des avem nevoie să realizăm o acțiune similară în multe locuri ale script-ului.

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

All reactions
Comment thread 1-js/02-first-steps/15-function-basics/article.md Outdated
Funcțiile sunt principalele "blocuri de construcție" ale programului. Ele permit apelarea codului de mai multe ori fără repetare.

We've already seen examples of built-in functions, like `alert(message)`, `prompt(message, default)` and `confirm(question)`. But we can create functions of our own as well.
Am văzut deja exemple de funcții încorporate, precum `alert(message)`, `prompt(message, default)` și `confirm(question)`. Dar putem crea și funcții proprii.

@bogdanbacosca bogdanbacosca Jan 20, 2023

Copy link
Copy Markdown
Contributor

There was a problem hiding this comment.

Choose a reason for hiding this comment

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

Suggested change
Am văzut deja exemple de funcții încorporate, precum `alert(message)`, `prompt(message, default)` și `confirm(question)`. Dar putem crea și funcții proprii.
Am văzut deja exemple de funcții încorporate, precum `alert(message)`, `prompt(message, default)` și `confirm(question)`. Dar putem crea și funcții proprii de asemenea.

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

All reactions
Comment thread 1-js/02-first-steps/15-function-basics/article.md Outdated
```

The second variant is easier to understand, isn't it? Instead of the code piece we see a name of the action (`isPrime`). Sometimes people refer to such code as *self-describing*.
A doua variantă este mai ușor de înțeles, nu-i aşa? În loc de piesa de cod, vedem un nume al acțiunii (`isPrime`). Uneori, oamenii se referă la un astfel de cod ca la *auto-descriere*.

@bogdanbacosca bogdanbacosca Jan 20, 2023

Copy link
Copy Markdown
Contributor

There was a problem hiding this comment.

Choose a reason for hiding this comment

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

Suggested change
A doua variantă este mai ușor de înțeles, nu-i aşa? În loc de piesa de cod, vedem un nume al acțiunii (`isPrime`). Uneori, oamenii se referă la un astfel de cod ca la *auto-descriere*.
A doua variantă este mai ușor de înțeles, nu-i aşa? În loc de piesa de cod, vedem un nume al acțiunii (`isPrime`). Uneori, oamenii se referă la un astfel de cod ca *auto-descriptiv*.

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

All reactions
Comment thread 1-js/02-first-steps/15-function-basics/article.md Outdated
O declarație de funcție arată astfel:

```js
function name(parameters, delimited, by, comma) {

@bogdanbacosca bogdanbacosca Jan 20, 2023

Copy link
Copy Markdown
Contributor

There was a problem hiding this comment.

Choose a reason for hiding this comment

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

Suggested change
function name(parameters, delimited, by, comma) {
function name(parametri, delimitați, de, virgulă) {

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

All reactions
Comment thread 1-js/02-first-steps/15-function-basics/article.md Resolved

Uh oh!

There was an error while loading. Please reload this page.

Comment thread 1-js/02-first-steps/15-function-basics/article.md Outdated
- A function may access outer variables. But it works only from inside out. The code outside of the function doesn't see its local variables.
- A function can return a value. If it doesn't, then its result is `undefined`.
- Valorile transmise unei funcții ca parametri sunt copiate în variabilele locale.
- funcția poate accesa variabile exterioare. Dar funcționează numai din interior spre exterior. Codul din afara funcției nu vede variabilele locale.

@bogdanbacosca bogdanbacosca Jan 20, 2023

Copy link
Copy Markdown
Contributor

There was a problem hiding this comment.

Choose a reason for hiding this comment

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

Suggested change
- funcția poate accesa variabile exterioare. Dar funcționează numai din interior spre exterior. Codul din afara funcției nu vede variabilele locale.
- Funcția poate accesa variabile exterioare. Dar funcționează numai din interior spre exterior. Codul din afara funcției nu vede variabilele locale.

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

All reactions
Comment thread 1-js/02-first-steps/15-function-basics/article.md Outdated
Pentru a face codul curat și ușor de înțeles, este recomandat să folosiți în principal variabile și parametri locali în funcție, nu variabile exterioare.

It is always easier to understand a function which gets parameters, works with them and returns a result than a function which gets no parameters, but modifies outer variables as a side-effect.
Este întotdeauna mai ușor de înțeles o funcție care primește parametri, lucrează cu ele și returnează un rezultat, decât o funcție care nu primește niciun parametru, dar modifică variabilele exterioare ca efect secundar.

@bogdanbacosca bogdanbacosca Jan 20, 2023

Copy link
Copy Markdown
Contributor

There was a problem hiding this comment.

Choose a reason for hiding this comment

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

ei se referă la parametri

Suggested change
Este întotdeauna mai ușor de înțeles o funcție care primește parametri, lucrează cu ele și returnează un rezultat, decât o funcție care nu primește niciun parametru, dar modifică variabilele exterioare ca efect secundar.
Este întotdeauna mai ușor de înțeles o funcție care primește parametri, lucrează cu ei și returnează un rezultat, decât o funcție care nu primește niciun parametru, dar modifică variabilele exterioare ca efect secundar.

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

All reactions
@javascript-translate-bot javascript-translate-bot added changes requested and removed review needed labels Jan 20, 2023
@javascript-translate-bot

javascript-translate-bot commented Jan 20, 2023

Copy link
Copy Markdown

Please make the requested changes. After it, add a comment "/done".
Then I'll ask for a new review 👻

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@marina-t-itf
adjusted
ad10bf3
marina-t-itf
marina-t-itf commented Jan 24, 2023
View reviewed changes

@marina-t-itf marina-t-itf left a comment

Copy link
Copy Markdown
Author

There was a problem hiding this comment.

Choose a reason for hiding this comment

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

Done

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

All reactions
bogdanbacosca
bogdanbacosca requested changes Jan 25, 2023
View reviewed changes

@bogdanbacosca bogdanbacosca left a comment

Copy link
Copy Markdown
Contributor

There was a problem hiding this comment.

Choose a reason for hiding this comment

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

Încă puține modificări minore.

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

All reactions
Comment thread 1-js/02-first-steps/15-function-basics/article.md Outdated
function showMessage() {
*!*
let message = "Hello, I'm JavaScript!"; // local variable
let message = "Bună, sunt JavaScript!"; // variabilă locală

@bogdanbacosca bogdanbacosca Jan 25, 2023

Copy link
Copy Markdown
Contributor

There was a problem hiding this comment.

Choose a reason for hiding this comment

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

Suggested change
let message = "Bună, sunt JavaScript!"; // variabilă locală
let message = "Bună, sunt JavaScript!"; // variabilă locală

Spațiu în plus

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

All reactions
Comment thread 1-js/02-first-steps/15-function-basics/article.md Outdated
## Valori implicite

If a function is called, but an argument is not provided, then the corresponding value becomes `undefined`.
Dacă o funcție este apelată, dar nu este oferit un argument, atunci valoarea corespunzătoare devine `nedefinită`.

@bogdanbacosca bogdanbacosca Jan 25, 2023

Copy link
Copy Markdown
Contributor

There was a problem hiding this comment.

Choose a reason for hiding this comment

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

Suggested change
Dacă o funcție este apelată, dar nu este oferit un argument, atunci valoarea corespunzătoare devine `nedefinită`.
Dacă o funcție este apelată, dar nu este oferit un argument, atunci valoarea corespunzătoare devine `undefined`.

Undefined este un cuvânt rezervat

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

All reactions
Comment thread 1-js/02-first-steps/15-function-basics/article.md Outdated
```

Modern JavaScript engines support the [nullish coalescing operator](info:nullish-coalescing-operator) `??`, it's better when most falsy values, such as `0`, should be considered "normal":
Motoarele JavaScript moderne susțin [nullish coalescing operator](info:nullish-coalescing-operator) `??`, este mai bine atunci când majoritatea valorilor false, cum ar fi `0`, ar trebui considerate „normale”:

@bogdanbacosca bogdanbacosca Jan 25, 2023

Copy link
Copy Markdown
Contributor

There was a problem hiding this comment.

Choose a reason for hiding this comment

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

Suggested change
Motoarele JavaScript moderne susțin [nullish coalescing operator](info:nullish-coalescing-operator) `??`, este mai bine atunci când majoritatea valorilor false, cum ar fi `0`, ar trebui considerate „normale”:
Motoarele JavaScript moderne susțin [nullish coalescing operator](info:nullish-coalescing-operator) `??`, este mai bine atunci când majoritatea valorilor falsy, cum ar fi `0`, ar trebui considerate „normale”:

Falsy este un termen tehnic

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

All reactions
Comment thread 1-js/02-first-steps/15-function-basics/article.md Outdated
```js run
function showCount(count) {
// if count is undefined or null, show "unknown"
// dacă numărul este nedefinit sau nul, afișază „necunoscut”

@bogdanbacosca bogdanbacosca Jan 25, 2023 •
edited
Loading

Uh oh!

There was an error while loading. Please reload this page.

Copy link
Copy Markdown
Contributor

There was a problem hiding this comment.

Choose a reason for hiding this comment

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

Suggested change
// dacă numărul este nedefinit sau nul, afișază „necunoscut”
// dacă count este undefined sau null, afișază „necunoscut”

count este un parametru definit

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

All reactions
Comment thread 1-js/02-first-steps/15-function-basics/article.md Outdated

````smart header="A function with an empty `return` or without it returns `undefined`"
If a function does not return a value, it is the same as if it returns `undefined`:
````smart header=" O funcție cu un 'return' gol sau fara o returnare este 'undefined'"

@bogdanbacosca bogdanbacosca Jan 25, 2023 •
edited
Loading

Uh oh!

There was an error while loading. Please reload this page.

Copy link
Copy Markdown
Contributor

There was a problem hiding this comment.

Choose a reason for hiding this comment

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

Suggested change
````smart header=" O funcție cu un 'return' gol sau fara o returnare este 'undefined'"
````smart header="O funcție cu un `return` gol sau fără o returnare este `undefined`"

Formatare

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

All reactions
Comment thread 1-js/02-first-steps/15-function-basics/article.md Outdated

````warn header="Never add a newline between `return` and the value"
For a long expression in `return`, it might be tempting to put it on a separate line, like this:
````warn header="Nu adăugați niciodată o linie nouă între `return` și o valoare"

@bogdanbacosca bogdanbacosca Jan 25, 2023

Copy link
Copy Markdown
Contributor

There was a problem hiding this comment.

Choose a reason for hiding this comment

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

Suggested change
````warn header="Nu adăugați niciodată o linie nouă între `return` și o valoare"
````warn header="Nu adăugați niciodată o linie nouă între `return` și valoare"

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

All reactions
Comment thread 1-js/02-first-steps/15-function-basics/article.md Outdated
```

So, it effectively becomes an empty return.
Deci, devine efectiv un `return` gol.

@bogdanbacosca bogdanbacosca Jan 25, 2023

Copy link
Copy Markdown
Contributor

There was a problem hiding this comment.

Choose a reason for hiding this comment

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

Suggested change
Deci, devine efectiv un `return` gol.
Deci, devine efectiv un return gol.

Textul original nu are formatare, dar poate fi adăugată printr-un PR separat în repozitoriul din limba engleză.

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

All reactions
Comment thread 1-js/02-first-steps/15-function-basics/article.md Outdated
````

## Naming a function [#function-naming]
## Denumirea unei funcții [#function-naming]

@bogdanbacosca bogdanbacosca Jan 25, 2023

Copy link
Copy Markdown
Contributor

There was a problem hiding this comment.

Choose a reason for hiding this comment

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

Suggested change
## Denumirea unei funcții [#function-naming]
## Denumind o funcție [#function-naming]

sau

Suggested change
## Denumirea unei funcții [#function-naming]
## Numind o funcție [#function-naming]

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

All reactions
Comment thread 1-js/02-first-steps/15-function-basics/article.md
checkPermission(..) // verifică o permisiune, returnează true/false
```

With prefixes in place, a glance at a function name gives an understanding what kind of work it does and what kind of value it returns.

@bogdanbacosca bogdanbacosca Jan 25, 2023

Copy link
Copy Markdown
Contributor

There was a problem hiding this comment.

Choose a reason for hiding this comment

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

With prefixes in place, a glance at a function name gives an understanding of what kind of work it does and what kind of value it returns.

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

All reactions
@javascript-translate-bot

javascript-translate-bot commented Jan 25, 2023

Copy link
Copy Markdown

Please make the requested changes. After it, add a comment "/done".
Then I'll ask for a new review 👻

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@bogdanbacosca
Merge branch 'master' into master
b6ba903
@bogdanbacosca

bogdanbacosca commented Jan 25, 2023

Copy link
Copy Markdown
Contributor

@marina-t-itf Am rezolvat câteva merge conflicts, sunt câteva bucăți netraduse adăugate.

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@marina-t-itf
adjusted
981af4d
marina-t-itf
marina-t-itf commented Jan 25, 2023
View reviewed changes

@marina-t-itf marina-t-itf left a comment

Copy link
Copy Markdown
Author

There was a problem hiding this comment.

Choose a reason for hiding this comment

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

Done

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

All reactions
@marina-t-itf

marina-t-itf commented Jan 25, 2023 via email

Copy link
Copy Markdown
Author
@bogdanbacosca <https://github.com/bogdanbacosca> Am faucet modificarile. Te rog sa ma anunti daca mai sunt necesare si altele. P.S: Este prima data cand lucrez intr-un proiect si cand folosesc PR. Este posibil sa fac greseli. Te rog sa ma anunti daca este cazul sa le remediez. Multumesc pentru ajutor.
…
On Wed, Jan 25, 2023 at 7:20 AM Bogdan Bacoșcă ***@***.***> wrote: @marina-t-itf <https://github.com/marina-t-itf> Am rezolvat câteva merge conflicts, sunt câteva bucăți netraduse adăugate. — Reply to this email directly, view it on GitHub <#169 (comment)>, or unsubscribe <https://github.com/notifications/unsubscribe-auth/AY7PNYAP3H4ZYDLKZ2PA373WUCZ2RANCNFSM6AAAAAAT7JTIGE> . You are receiving this because you were mentioned.Message ID: ***@***.***>
-- Multumesc, *___________________________________* *Gabor Marina Loredana* *Telefon*: *0737 557 623* *E*-*mail*: ***@***.***
All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

bogdanbacosca
bogdanbacosca requested changes Jan 25, 2023
View reviewed changes

@bogdanbacosca bogdanbacosca left a comment •
edited
Loading

Uh oh!

There was an error while loading. Please reload this page.

Copy link
Copy Markdown
Contributor

There was a problem hiding this comment.

Choose a reason for hiding this comment

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

Sunt câteva comentarii care nu au fost adresate și bucăți netraduse (care au fost introduse cand am rezolvat acel merge conflict)
Am găsit și câteva ghilimele formatate greșit.

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

All reactions
Comment thread 1-js/02-first-steps/15-function-basics/1-if-else-required/solution.md Outdated
Nicio diferență!

In both cases, `return confirm('Did parents allow you?')` executes exactly when the `if` condition is falsy. No newline at end of file
In both cases, `return confirm('Did parents allow you?')` executes exactly when the `if` condition is falsy.

@bogdanbacosca bogdanbacosca Jan 25, 2023

Copy link
Copy Markdown
Contributor

There was a problem hiding this comment.

Choose a reason for hiding this comment

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

Netradus

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

All reactions
Comment thread 1-js/02-first-steps/15-function-basics/article.md Outdated
Now if the `text` parameter is not passed, it will get the value `"no text given"`.
Acum dacă parametrul `text` nu este trecut, va primi valoarea `"nu este dat niciun text"

The default value also jumps in if the parameter exists, but strictly equals `undefined`, like this:

@bogdanbacosca bogdanbacosca Jan 25, 2023

Copy link
Copy Markdown
Contributor

There was a problem hiding this comment.

Choose a reason for hiding this comment

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

Netradus

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

All reactions
Comment thread 1-js/02-first-steps/15-function-basics/article.md Outdated
The default value also jumps in if the parameter exists, but strictly equals `undefined`, like this:

```js
showMessage("Ann", undefined); // Ann: no text given

@bogdanbacosca bogdanbacosca Jan 25, 2023

Copy link
Copy Markdown
Contributor

There was a problem hiding this comment.

Choose a reason for hiding this comment

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

Netradus

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

All reactions
Comment thread 1-js/02-first-steps/15-function-basics/article.md Outdated
Pe de altă parte, este apelat independent de fiecare dată când lipsește `text`.
```

````smart header="Default parameters in old JavaScript code"

@bogdanbacosca bogdanbacosca Jan 25, 2023

Copy link
Copy Markdown
Contributor

There was a problem hiding this comment.

Choose a reason for hiding this comment

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

Netradus

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

All reactions
Comment thread 1-js/02-first-steps/15-function-basics/article.md Outdated
@@ -267,52 +267,52 @@ function showMessage(from, text) {

Sometimes it makes sense to assign default values for parameters at a later stage after the function declaration.

@bogdanbacosca bogdanbacosca Jan 25, 2023

Copy link
Copy Markdown
Contributor

There was a problem hiding this comment.

Choose a reason for hiding this comment

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

Netradus

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

All reactions
Comment thread 1-js/02-first-steps/15-function-basics/article.md Outdated
```js
function showMessage(text) {
// if text is undefined or otherwise falsy, set it to 'empty'
// dacă textul este nedefinit sau fals, setați-l ca „gol”

@bogdanbacosca bogdanbacosca Jan 25, 2023

Copy link
Copy Markdown
Contributor

There was a problem hiding this comment.

Choose a reason for hiding this comment

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

Suggested change
// dacă textul este nedefinit sau fals, setați-l ca „gol”
// dacă textul este nedefinit sau fals, setați-l ca 'empty'

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

All reactions
Comment thread 1-js/02-first-steps/15-function-basics/article.md Outdated
```

Modern JavaScript engines support the [nullish coalescing operator](info:nullish-coalescing-operator) `??`, it's better when most falsy values, such as `0`, should be considered "normal":
Motoarele JavaScript moderne susțin [nullish coalescing operator](info:nullish-coalescing-operator) `??`, este mai bine atunci când majoritatea valorilor false, cum ar fi `0`, ar trebui considerate „normale”:

@bogdanbacosca bogdanbacosca Jan 25, 2023

Copy link
Copy Markdown
Contributor

There was a problem hiding this comment.

Choose a reason for hiding this comment

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

Suggested change
Motoarele JavaScript moderne susțin [nullish coalescing operator](info:nullish-coalescing-operator) `??`, este mai bine atunci când majoritatea valorilor false, cum ar fi `0`, ar trebui considerate „normale”:
Motoarele JavaScript moderne susțin [nullish coalescing operator](info:nullish-coalescing-operator) `??`, este mai bine atunci când majoritatea valorilor false, cum ar fi `0`, ar trebui considerate "normale":

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

All reactions
Comment thread 1-js/02-first-steps/15-function-basics/article.md Outdated
```js run
function showCount(count) {
// if count is undefined or null, show "unknown"
// dacă numărul este nedefinit sau nul, afișază „necunoscut”

@bogdanbacosca bogdanbacosca Jan 25, 2023

Copy link
Copy Markdown
Contributor

There was a problem hiding this comment.

Choose a reason for hiding this comment

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

Suggested change
// dacă numărul este nedefinit sau nul, afișază „necunoscut”
// dacă numărul este nedefinit sau nul, afișază "necunoscut"

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

All reactions
Comment thread 1-js/02-first-steps/15-function-basics/article.md Resolved

Uh oh!

There was an error while loading. Please reload this page.

Comment thread 1-js/02-first-steps/15-function-basics/article.md Outdated

```js
return*!*;*/!*
(some + long + expression + or + whatever * f(a) + f(b))

@bogdanbacosca bogdanbacosca Jan 25, 2023

Copy link
Copy Markdown
Contributor

There was a problem hiding this comment.

Choose a reason for hiding this comment

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

Netradus

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

All reactions
@javascript-translate-bot

javascript-translate-bot commented Jan 25, 2023

Copy link
Copy Markdown

Please make the requested changes. After it, add a comment "/done".
Then I'll ask for a new review 👻

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

marina-t-itf added 2 commits January 25, 2023 18:09
@marina-t-itf
adjusted
d6ace89
@marina-t-itf
ajusted
cd59785
@marina-t-itf
marina-t-itf requested a review from bogdanbacosca March 4, 2023 09:23
bogdanbacosca
bogdanbacosca requested changes Mar 4, 2023
View reviewed changes

@bogdanbacosca bogdanbacosca left a comment

Copy link
Copy Markdown
Contributor

There was a problem hiding this comment.

Choose a reason for hiding this comment

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

Avem câteva bucăți netraduse, o linie în plus, am modifical fals cu falsy pentru că este un termen tehnic, am modificat în unele părți transmis în loc de trecut (pentru consistență).
Vezi toate comentariile pentru mai multe detalii.
Mulțumesc pentru PR 👍 😄
Încă putine modificări și este gata.

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

All reactions
Comment thread 1-js/02-first-steps/15-function-basics/1-if-else-required/solution.md
Nicio diferență.

In both cases, `return confirm('Did parents allow you?')` executes exactly when the `if` condition is falsy. No newline at end of file
În ambele cazuri, `return confirmă('Ți-au permis părinții?')` se execută exact când condiția `if` este falsă. No newline at end of file

@bogdanbacosca bogdanbacosca Mar 4, 2023

Copy link
Copy Markdown
Contributor

There was a problem hiding this comment.

Choose a reason for hiding this comment

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

Suggested change
În ambele cazuri, `return confirmă('Ți-au permis părinții?')` se execută exact când condiția `if` este falsă.
În ambele cazuri, `return confirm('Ți-au permis părinții?')` se execută exact când condiția `if` este falsy.

falsy este un termen tehnic

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

All reactions
Comment thread 1-js/02-first-steps/15-function-basics/2-rewrite-function-question-or/task.md
```

Rewrite it, to perform the same, but without `if`, in a single line.
Rescrie-l, pentru a efectua la fel, dar fără `if`, într-o singură linie.

@bogdanbacosca bogdanbacosca Mar 4, 2023

Copy link
Copy Markdown
Contributor

There was a problem hiding this comment.

Choose a reason for hiding this comment

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

Suggested change
Rescrie-l, pentru a efectua la fel, dar fără `if`, într-o singură linie.
Rescrie-l, pentru a efectua același lucru, dar fără `if`, într-o singură linie.

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

All reactions
Comment thread 1-js/11-async/08-async-await/03-async-from-regular/task.md
@@ -1,7 +1,7 @@

# Apelarea asincronă din non-asincronă
# Call async from non-async

@bogdanbacosca bogdanbacosca Mar 4, 2023

Copy link
Copy Markdown
Contributor

There was a problem hiding this comment.

Choose a reason for hiding this comment

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

Versiunea în Engleză s-a suprapus peste traducere.
Trebuie ajustată toată sarcina.

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

All reactions
Comment thread 1-js/02-first-steps/15-function-basics/article.md
```

The function has full access to the outer variable. It can modify it as well.
Funcția are acces complet la variabila exterioară. Il poate modifica si ea.

@bogdanbacosca bogdanbacosca Mar 4, 2023

Copy link
Copy Markdown
Contributor

There was a problem hiding this comment.

Choose a reason for hiding this comment

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

Suggested change
Funcția are acces complet la variabila exterioară. Il poate modifica si ea.
Funcția are acces deplin la variabila exterioară. O poate modifica de asemenea.

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

All reactions
Comment thread 1-js/02-first-steps/15-function-basics/article.md
- `checkPermission` -- would be bad if it displays the `access granted/denied` message (should only perform the check and return the result).
- `getAge` -- ar fi rău dacă arată o `alert` cu vârsta (ar trebui doar să obțină).
- `createForm` -- ar fi rău dacă ar modifica documentul, adăugându-i o formă (ar trebui doar să-l creeze și să-l returneze).
- `checkPermission` -- ar fi rău dacă afișează mesajul „acces acordat/refuzat”. (ar trebui să efectueze doar verificarea și să returneze rezultatul).

@bogdanbacosca bogdanbacosca Mar 4, 2023

Copy link
Copy Markdown
Contributor

There was a problem hiding this comment.

Choose a reason for hiding this comment

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

Suggested change
- `checkPermission` -- ar fi rău dacă afișează mesajul „acces acordat/refuzat”. (ar trebui să efectueze doar verificarea și să returneze rezultatul).
- `checkPermission` -- ar fi rău dacă afișează mesajul "acces acordat/refuzat". (ar trebui să efectueze doar verificarea și să returneze rezultatul).

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

All reactions
Comment thread 1-js/02-first-steps/15-function-basics/article.md
Funcțiile care sunt folosite *foarte des* au uneori nume ultrascurte.

For example, the [jQuery](https://jquery.com/) framework defines a function with `$`. The [Lodash](https://lodash.com/) library has its core function named `_`.
Ca de exemplu, framework-ul [jQuery](http://jquery.com) definește o funcție cu `$`. Librăria [Lodash](http://lodash.com/) are funcția sa de bază numită `_`.

@bogdanbacosca bogdanbacosca Mar 4, 2023

Copy link
Copy Markdown
Contributor

There was a problem hiding this comment.

Choose a reason for hiding this comment

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

Suggested change
Ca de exemplu, framework-ul [jQuery](http://jquery.com) definește o funcție cu `$`. Librăria [Lodash](http://lodash.com/) are funcția sa de bază numită `_`.
Ca de exemplu, framework-ul [jQuery](https://jquery.com) definește o funcție cu `$`. Librăria [Lodash](https://lodash.com/) are funcția sa de bază numită `_`.

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

All reactions
Comment thread 1-js/02-first-steps/15-function-basics/article.md
Prima variantă folosește o etichetă:

```js
function showPrimes(n) {

@bogdanbacosca bogdanbacosca Mar 4, 2023

Copy link
Copy Markdown
Contributor

There was a problem hiding this comment.

Choose a reason for hiding this comment

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

comentariul poate fi tradus

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

All reactions
Comment thread 1-js/02-first-steps/15-function-basics/article.md
A doua variantă folosește o funcție adițională `isPrime(n)` pentru a testa primalitatea:

```js
function showPrimes(n) {

@bogdanbacosca bogdanbacosca Mar 4, 2023

Copy link
Copy Markdown
Contributor

There was a problem hiding this comment.

Choose a reason for hiding this comment

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

și aici comentariul poate fi tradus

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

All reactions
Comment thread 1-js/02-first-steps/15-function-basics/article.md
```

The second variant is easier to understand, isn't it? Instead of the code piece we see a name of the action (`isPrime`). Sometimes people refer to such code as *self-describing*.
A doua variantă este mai ușor de înțeles, nu-i aşa? În loc de piesa de cod, vedem un nume al acțiunii (`isPrime`). Uneori, oamenii se referă la un astfel de cod ca *auto-descriptiv*.

@bogdanbacosca bogdanbacosca Mar 4, 2023

Copy link
Copy Markdown
Contributor

There was a problem hiding this comment.

Choose a reason for hiding this comment

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

Suggested change
A doua variantă este mai ușor de înțeles, nu-i aşa? În loc de piesa de cod, vedem un nume al acțiunii (`isPrime`). Uneori, oamenii se referă la un astfel de cod ca *auto-descriptiv*.
A doua variantă este mai ușor de înțeles, nu-i aşa? În loc de bucata de cod, vedem un nume al acțiunii (`isPrime`). Uneori, oamenii se referă la un astfel de cod ca *auto-descriptiv*.

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

All reactions
Comment thread 1-js/02-first-steps/15-function-basics/article.md Resolved

Uh oh!

There was an error while loading. Please reload this page.

@javascript-translate-bot

javascript-translate-bot commented Mar 4, 2023

Copy link
Copy Markdown

Please make the requested changes. After it, add a comment "/done".
Then I'll ask for a new review 👻

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@marina-t-itf marina-t-itf closed this Jan 8, 2024
@marina-t-itf marina-t-itf reopened this Jul 10, 2024
MarinaG
Update solution.md
0101de4
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Reviewers

@bogdanbacosca bogdanbacosca bogdanbacosca requested changes

Requested changes must be addressed to merge this pull request.

Uh oh!

There was an error while loading. Please reload this page.

Assignees

No one assigned

Labels

changes requested

Projects

None yet

Milestone

No milestone

Development

Successfully merging this pull request may close these issues.

Uh oh!

There was an error while loading. Please reload this page.

4 participants

@marina-t-itf @CLAassistant @javascript-translate-bot @bogdanbacosca
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
You are visitor 01402503 — GeezerVison does not store the pages you look up.
Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.