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 a = 'global'; //I am a global scope | |
function iAmLocal() { //I am a global scope | |
console.log(a) // 'global' | |
} //I am a global scope |
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 a = 'global'; | |
function iAmLocal() { | |
a = 'is I am local'; | |
} | |
iAmLocal(); | |
a; //Think and let's give it a moment ?? |
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 a = 'global'; | |
function iAMLocal() { | |
var b = 'local'; | |
} | |
a; //'global' | |
b; //?? |
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 sum() { | |
var a = 5; | |
var result = 0; | |
// Declaring second function | |
function secondNumber() { | |
var b = 10; | |
return a+b; | |
} |
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 num1 = 5; //globally | |
function add() { | |
var num2 = 8; //locally | |
return function() { //returning function | |
return num1 + num2; //returning function | |
} //returning function | |
} |
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
for(var i = 1; i <= 10; i++) { | |
console.log(i); | |
} | |
i; //Can I access it out side??. |
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
for(let i = 1; i <= 10; i++) { | |
console.log(i); | |
} | |
i; //Can I access i now?? |
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
{ | |
"name": "Chrome Extension Blog", | |
"description" : "This chrome extension has code for chrome extension blog", | |
"version": "1.0", | |
"manifest_version": 2, | |
"browser_action": { | |
"default_popup": "index.html", | |
"default_title": "New Tab", | |
"default_icon": "/img/logo.png" | |
}, |
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
/* Time Block CSS */ | |
.time_block { | |
text-align: center; | |
font-size: 5rem; | |
} | |
.time_block h1 { | |
margin: 1rem 0; | |
} |
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 hourElm = document.getElementById('hour'); | |
const minutesElm = document.getElementById('minutes'); | |
// function to set time | |
function setTime() { | |
let now = new Date(); | |
hourElm.innerHTML = now.getHours(); | |
minutesElm.innerHTML = now.getMinutes(); | |
} |
OlderNewer