Created
April 2, 2020 16:08
-
-
Save MoisesTedeschi/cf910f0b0564e8d2eaac3976a371f7de to your computer and use it in GitHub Desktop.
Demonstração: Conhecendo o if, else e else if
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
| //Valor que vou informar é: '1010'. | |
| const args = process.argv; | |
| const saldo = args[args.length - 1]; | |
| //console.log(saldo); | |
| //console.log('args', args); | |
| if (isNaN(saldo)) { | |
| console.log('Não é um número válido!!'); | |
| return; | |
| } else { | |
| console.log(typeof (saldo)); | |
| //O tipo do valor informado é uma String. | |
| } |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment