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
function dobro(numero) { | |
console.log(numero + numero); | |
} | |
dobro(5); // 10 | |
dobro('teste'); // 'testeteste' |
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
class Car { | |
cor = 'verde'; | |
} | |
const car1 = new Car(); | |
const car2 = { | |
cor: 'verde', | |
} |
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
<?php | |
class Car { | |
public $cor = 'verde'; | |
} | |
$car1 = new Car(); // Cria uma instancia da classe Car | |
$car2 = new stdClass(); // Cria uma instancia de um Objeto Genérico | |
$car2->cor = 'verde'; // define as mesmas propriedades da classe Car |