$(function(){
console.info("Aprendendo jQuery em 1 hora");
var number = 1;
var numberB = 2;
var text = "Testando";
var result = number + numberB;
var check = number < numberB;
console.info(number);
console.info(text);
console.info(result);
console.info(check);
function name(p1, p2, p3){
//Código da Função
//name é o nome da função
// p1, p2 e p3 são parametros para executar a função
// return retorna um valor não sendo necessário uma variável auxiliar
}
function sumTwoNumber(first, second){
return first + second;
}
console.info(sumTwoNumber(4,7)); // chama-se a função e atribui o valor para cada parametro
console.info(sumTwoNumber(5,7));
console.info(sumTwoNumber(4,45));
//Exercicios
function comparative(numberA, numberC){
return numberA < numberC;
}
console.info(comparative(8,9));
function incremento(valorA, valorB){
return valorA >= valorB;
}
console.info(incremento(5,4));
function checkNumbers(n1,n2){
return n1 == n2;
}
console.info(checkNumbers(3,6))
});
//Manipular elementos HTML com jQuery
Please Whitelist JSFiddle in your content blocker.
Help keep JSFiddle free for always by one of two ways:
Whitelist JSFiddle in your content blocker (two clicks)
Go PRO and get access to additional PRO features →
Join the 4+ million users, and keep the JSFiddle dream alive.
Ad-free
All ads in the editor and listing pages are turned completely off.
Use pre-released features
You get to try and use features (like the Palette Color Generator) months before everyone else.
Fiddle collections
Sort and categorize your Fiddles into multiple collections.
Private collections and fiddles
You can make as many Private Fiddles, and Private Collections as you wish!
Console
Debug your Fiddle with a minimal built-in JavaScript console.