Skip to content

Instantly share code, notes, and snippets.

@cassiomarques
Created November 15, 2011 16:33
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save cassiomarques/1367515 to your computer and use it in GitHub Desktop.
Save cassiomarques/1367515 to your computer and use it in GitHub Desktop.
value1 = 10;
var value2 = 0;
if(value2 == '') {
console.log("Não deveria ter sido executado!");
}
var funA = function() {
value1 = value1 * 2;
}
funA();
console.log("O valor de 9 * 10 é " + 9 * value1);
var value3 = "bla" * 10;
if(value3 === NaN) {
console.log("Deveria ter sido executado...");
}
// O método concat() dos tipos String e Array realizam a concatenação do objeto com o
// atributo recebido
var value4 = "blabla";
value4.concat(" bleble");
if(value4 === "blabla bleble") {
console.log("Deveria ter sido executado...");
}
var value5 = [1,2,3];
value5.concat([4,5]);
if(value5.length == 5) {
console.log("Deveria ter sido executado...");
}
var obj = {abc: 10, def: 20};
var value6 = obj.ghi;
if(value6 === null) {
console.log("Deveria ter sido executado...");
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment