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
/** | |
* In this folder (creational.patterns/factory.pattern/) you will find an | |
* example implementation of the Factory design pattern. This means that | |
* you will see that things were created without using the word 'new'. | |
* | |
* @author Jean J. Michel | |
*/ | |
class iPhoneFamily { | |
public version: string; | |
public suportedIOs: number; |
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
const saudarPessoa = (saudacaoNoIdiomaX) => (nomePessoa) => console.log(`${saudacaoNoIdiomaX} ${nomePessoa}`); | |
const saudarEmIngles = saudarPessoa('Good morning'); | |
const saudarEmEspanhol = saudarPessoa('Buen día'); | |
const saudarEmAlemao = saudarPessoa('Guten Morgen'); | |
saudarEmIngles('John'); | |
saudarEmEspanhol('Juan'); | |
saudarEmAlemao('Jean'); | |
//É o mesmo que |
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
version: 2.1 | |
references: | |
default_container_config: &default_container_config | |
docker: | |
- image: circleci/node:10 | |
working_directory: ~/repo | |
commands: | |
install_and_cache_dependencies: | |
description: "Checkout, get cache, install and save cache" | |
steps: |
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 myBet = Math.floor(Math.random() * 3) + 1; | |
var acceptChangeInitialBet = Math.floor(Math.random() * 2) + 1; | |
function game(initialBet, changeInitialBet) { | |
var portsAndPrizes = []; | |
var carPort = Math.floor(Math.random() * 3) + 1; | |
var newBet; | |
var discardedDoor; | |
var finalGoatDoor; | |
var finalBet; |
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
console.debug(`Criando um obj contaCorrente para iniciar o teste`) | |
const contaCorrente = { | |
numero: 123456, | |
cliente: 321, | |
saldo: 5000 | |
}; | |
const verificarTransacao = (tipoTransacao, contaCorrente, valorTransacao) => { | |
console.info(`verificarTransacao: Tipo de Transação = ${tipoTransacao} Conta Número = ${contaCorrente.numero} Cliente = ${contaCorrente.cliente} Saldo = ${contaCorrente.saldo} Valor Transação = ${valorTransacao}`) | |
let liberada |
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 matrix = { | |
create: function(rows, columns) { | |
var newMatrix = []; | |
for (var i = 0; i < rows; i++) { | |
var row = []; | |
for (var j = 0; j < columns; j++) { | |
row.push(0); // Inicializa a matriz com valores zero | |
} | |
newMatrix.push(row); | |
} |