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
//objeto cachorro com função de latir | |
//contador 0 a 100 usando o loop "for" | |
var produto = { | |
nome: 'Serra elétrica', | |
preco: 21.09, | |
quantidade: 10, | |
comprar: function (quantidade) { | |
if (produto.quantidade > 0 && quantidade <= produto.quantidade) { | |
return produto.quantidade - quantidade; |
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 produto1 = { | |
nome: 'Furadeira', | |
valor: 100.0, | |
estoque: 3 | |
} | |
var produto2 = { | |
nome: 'Mesa', | |
valor: 800.0, | |
estoque: 1 |
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' | |
}; |