Skip to content

Instantly share code, notes, and snippets.

View wfuertes's full-sized avatar
🏠
Working from home

Willian Fuertes Batista wfuertes

🏠
Working from home
View GitHub Profile
src/
service/
consultaLivroService.js
function Conta(options) {
//atributos privados
var options = options;
//Metodos publicos [OBJETO CONTA]
return {
saca: function(valor) {
if (valor <= 0) throw "Valor deve ser maior de ZERO!";
if (options.saldo >= valor) {
//Criando uma função construtora para simular uma classe: Person.
function Person(options) {
//attributos públicos
this.name = options.name;
this.gender = options.gender;
//métodos públicos
this.speak = function() {
console.log(this.name + ' sabe falar!');
};