- Notifications
You must be signed in to change notification settings - Fork230
Eval: run a code string#303
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
Uh oh!
There was an error while loading.Please reload this page.
Merged
Changes fromall commits
Commits
Show all changes
9 commits Select commitHold shift + click to select a range
b70f45c 1-99-2 eval
joaquinelioe790056 Update article.md
joaquinelioc4ef465 Update 1-js/99-js-misc/02-eval/1-eval-calculator/solution.md
joaquineliodc392a0 Update solution.md
joaquinelio0fc1688 Update 1-js/99-js-misc/02-eval/1-eval-calculator/solution.md
joaquineliod3125a1 Update 1-js/99-js-misc/02-eval/article.md
joaquineliof9641fa Update 1-js/99-js-misc/02-eval/article.md
joaquineliocfc3adf Update 1-js/99-js-misc/02-eval/article.md
joaquinelio9f5e957 Update 1-js/99-js-misc/02-eval/article.md
joaquinelioFile filter
Filter by extension
Conversations
Failed to load comments.
Loading
Uh oh!
There was an error while loading.Please reload this page.
Jump to
Jump to file
Failed to load files.
Loading
Uh oh!
There was an error while loading.Please reload this page.
Diff view
Diff view
There are no files selected for viewing
8 changes: 4 additions & 4 deletions1-js/99-js-misc/02-eval/1-eval-calculator/solution.md
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,11 +1,11 @@ | ||
| Usemos`eval`para calcular la expresión matemática: | ||
| ```js demo run | ||
| let expr = prompt("Escribe una expresión matemática:", '2*3+2'); | ||
| alert( eval(expr) ); | ||
| ``` | ||
| Aunque el usuario puede ingresar cualquier texto o código. | ||
| Para hacer las cosas seguras, y limitarlo a aritmética solamente, podemos verificar`expr`usando una [expresión regular](info:regular-expressions) que solo pueda contener dígitos y operadores. |
6 changes: 3 additions & 3 deletions1-js/99-js-misc/02-eval/1-eval-calculator/task.md
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.Learn more about bidirectional Unicode characters
68 changes: 34 additions & 34 deletions1-js/99-js-misc/02-eval/article.md
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.Learn more about bidirectional Unicode characters
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.