Skip to content

The "new Function" syntax #156

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

Merged
merged 12 commits into from
May 5, 2024
Next Next commit
Update article.md
  • Loading branch information
tfbio authored Jul 18, 2020
commit c77fadf8bb30d7f4be0d25265ab7694001325b71
10 changes: 5 additions & 5 deletions 1-js/06-advanced-functions/07-new-function/article.md
Original file line number Diff line number Diff line change
@@ -1,17 +1,17 @@

# The "new Function" syntax
# A sintaxe de "new Function"

There's one more way to create a function. It's rarely used, but sometimes there's no alternative.
Existe mais uma maneira de criar uma funcção. Ela é raramente usada, mas as vezes não existe alternativas.

## Syntax
## Sintaxe

The syntax for creating a function:
A sintaxe para criar uma função:

```js
let func = new Function ([arg1[, arg2[, ...argN]],] functionBody)
```

In other words, function parameters (or, more precisely, names for them) go first, and the body is last. All arguments are strings.
Em outras palavras, os parâmetros da função (ou, mais precisamente, os nomes deles) vêm primeiro, e o corpo da função vem por último. Todos os argumentos são `strings`.

It's easier to understand by looking at an example. Here's a function with two arguments:

Expand Down