Created
July 1, 2020 20:51
-
-
Save fehmathais/11c3b1d503ec9674da4c9a7161f53a87 to your computer and use it in GitHub Desktop.
This file contains 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
var ativo = false; // true ou false | |
var nome = 'felipe'; //string - texto | |
var idade = 19; //número - inteiro | |
var preco = 21.50; //decimal - double | |
var frutas = ['banana', 'maça', 'laranja']; | |
var cachorro = { | |
nome: 'lupi', | |
idade: '4 meses', | |
raca: 'labrador' | |
}; | |
var soma = function (a, b) { | |
return a + b; | |
} | |
var subtrair = function (a, b) { | |
return a - b; | |
} | |
var divisao = function (a, b) { | |
return a / b; | |
} | |
var multiplica = function (a, b) { | |
return a * b; | |
} | |
var sobra_divisao = function (a, b) { | |
return a % b; | |
} | |
// - "e" condicional (&&) | |
// - "ou" condicional (||) | |
// - "é igual" (==) | |
// - "maior ou igual" (>=) | |
// - "menor ou igual" (<=) | |
// - "maior que" (>) | |
// - "menor que" (<) | |
// - "diferente de" (!==) | |
var saldo = 2000; | |
var saque = 1280; | |
if (saque > 0 && saque <= saldo) { | |
var novo_saldo = saldo - saque; | |
console.log('valor sacado é de:' + saque); | |
console.log('novo saldo ' + novo_saldo); | |
} else { | |
console.log('vc não pode sacar esse valor') | |
} | |
// console.log(sobra_divisao(1, 2)); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment