├── .gitignore ├── README.md ├── aula02 ├── olaMundo.html ├── olaMundo.js └── olaMundo2.html ├── aula03 ├── app.js └── index.html └── aula05 ├── exemplo01.html ├── exemplo01.js ├── exemplo02.html ├── exemplo02.js ├── exemplo03.html ├── exemplo03.js ├── exemplo04.html └── exemplo04.js /.gitignore: -------------------------------------------------------------------------------- 1 | # Created by .ignore support plugin (hsz.mobi) 2 | ### JetBrains template 3 | # Covers JetBrains IDEs: IntelliJ, RubyMine, PhpStorm, AppCode, PyCharm, CLion 4 | 5 | *.iml 6 | 7 | ## Directory-based project format: 8 | .idea/ 9 | # if you remove the above rule, at least ignore the following: 10 | 11 | # User-specific stuff: 12 | # .idea/workspace.xml 13 | # .idea/tasks.xml 14 | # .idea/dictionaries 15 | 16 | # Sensitive or high-churn files: 17 | # .idea/dataSources.ids 18 | # .idea/dataSources.xml 19 | # .idea/sqlDataSources.xml 20 | # .idea/dynamic.xml 21 | # .idea/uiDesigner.xml 22 | 23 | # Gradle: 24 | # .idea/gradle.xml 25 | # .idea/libraries 26 | 27 | # Mongo Explorer plugin: 28 | # .idea/mongoSettings.xml 29 | 30 | ## File-based project format: 31 | *.ipr 32 | *.iws 33 | 34 | ## Plugin-specific files: 35 | 36 | # IntelliJ 37 | /out/ 38 | 39 | # mpeltonen/sbt-idea plugin 40 | .idea_modules/ 41 | 42 | # JIRA plugin 43 | atlassian-ide-plugin.xml 44 | 45 | # Crashlytics plugin (for Android Studio and IntelliJ) 46 | com_crashlytics_export_strings.xml 47 | crashlytics.properties 48 | crashlytics-build.properties 49 | 50 | 51 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | Curso JavaScript 2 | ================= 3 | 4 | ## Link do curso: http://loiane.training 5 | 6 | ## Código fonte apresentado no curso de JavaScript gratuito 7 | 8 | ## Link Playlist Youtube: -------------------------------------------------------------------------------- /aula02/olaMundo.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 11 | 12 | -------------------------------------------------------------------------------- /aula02/olaMundo.js: -------------------------------------------------------------------------------- 1 | alert('Olá, mundo!'); -------------------------------------------------------------------------------- /aula02/olaMundo2.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | -------------------------------------------------------------------------------- /aula03/app.js: -------------------------------------------------------------------------------- 1 | alert('Olá, mundo!'); //mostra popup 2 | 3 | console.log('Olá, mundo!'); //mostra mensagem no console - Developer Tools 4 | 5 | document.write('Olá, mundo!'); //mostra mensagem na página HTML -------------------------------------------------------------------------------- /aula03/index.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | -------------------------------------------------------------------------------- /aula05/exemplo01.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | -------------------------------------------------------------------------------- /aula05/exemplo01.js: -------------------------------------------------------------------------------- 1 | /* 2 | Declarando variáveis no JavaScript 3 | Esse comentário tem mais de uma linha 4 | */ 5 | 6 | var minhaVariavel = 'abcdef'; //variáveis são case-sensitive 7 | 8 | var _$minhaVariavel = 'mnopq'; // _ e $ também é permitido 9 | 10 | //não é permitido começar nome de variável como número 11 | //var 1minhaVariavel = 'asdfg'; 12 | 13 | //número no meio ou final é OK 14 | var minha1Variavel2 = 'ghijkl'; 15 | 16 | console.log(minhaVariavel); 17 | console.log(_$minhaVariavel); 18 | console.log(minha1Variavel2); 19 | 20 | 21 | -------------------------------------------------------------------------------- /aula05/exemplo02.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | -------------------------------------------------------------------------------- /aula05/exemplo02.js: -------------------------------------------------------------------------------- 1 | //má prática sem declarar a variável 2 | minhaVariavel2 = 'qwerty'; 3 | 4 | var minhaVariavel = 'abcdef'; 5 | 6 | //má prática declarar duplicado 7 | var minhaVariavel = 'zxcvb'; 8 | 9 | console.log(minhaVariavel3); 10 | console.log(minhaVariavel); -------------------------------------------------------------------------------- /aula05/exemplo03.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | -------------------------------------------------------------------------------- /aula05/exemplo03.js: -------------------------------------------------------------------------------- 1 | "use strict"; 2 | 3 | //erro, variável não declarada 4 | minhaVariavel2 = 'qwerty'; 5 | 6 | // mas não faz nada em relação a isso 7 | var minhaVariavel = 'abcdef'; 8 | 9 | //má prática declarar duplicado 10 | var minhaVariavel = 'zxcvb'; 11 | 12 | console.log(minhaVariavel2); 13 | console.log(minhaVariavel); -------------------------------------------------------------------------------- /aula05/exemplo04.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | -------------------------------------------------------------------------------- /aula05/exemplo04.js: -------------------------------------------------------------------------------- 1 | //EcmaScript 6 - EcmaScript 2015 2 | 3 | let minhaVariavel = 'poiuy'; 4 | 5 | var minhaVariavel = 'abcde'; //vai dar erro 6 | 7 | //constantes devem ser declaradas com letras maiusculas - boa prática 8 | const PI = 3.14159; 9 | 10 | PI = 1; //não é possível atribuir novo valor; 11 | 12 | console.log(minhaVariavel); 13 | console.log(PI); --------------------------------------------------------------------------------