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 add(a = 5, b = 10) { | |
return a + b; | |
} | |
console.log(add()); //15 |
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 add(a, b) { | |
return a + b; | |
} | |
//or | |
var add = function(a,b){ | |
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 add = (a, b) => { | |
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
const delay = seconds => { | |
return new Promise( | |
resolve => setTimeout(resolve, seconds * 1000) | |
) | |
}; | |
const counter = async() => { | |
await delay(1); | |
console.log('one second'); | |
await delay(1); |
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 repos = async(loginName) => { | |
try { | |
var response = await fetch(`https://api.github.com/users/${loginName}/repos`); | |
var json = await response.json(); | |
var followerList = json.map(repo => repo.name); | |
console.log(followerList); | |
} catch (error) { | |
console.log(`Error: ${error}`); | |
} |
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* hello() { | |
yield 'Hello Gisela'; | |
yield 'Hello Alicia'; | |
yield 'Hello Bea'; | |
} | |
var helloInstance = hello(); | |
console.log(helloInstance.next()); | |
console.log(helloInstance.next()); | |
console.log(helloInstance.next()); |
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 | |
// src/Controller/HelloAzureController.php | |
namespace App\Controller; | |
use Symfony\Component\HttpFoundation\Response; | |
use Symfony\Component\Routing\Annotation\Route; | |
class HelloAzureController | |
{ | |
/** |
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
<configuration> | |
<system.webServer> | |
<rewrite> | |
<rules> | |
<clear /> | |
<rule name="BlockAccessToPublic" patternSyntax="Wildcard" stopProcessing="true"> | |
<match url="*" /> | |
<conditions logicalGrouping="MatchAll" trackAllCaptures="false"> | |
<add input="{URL}" pattern="/public/*" /> | |
</conditions> |
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 ChuckNorrisFact = () => { | |
return new Promise((resolves, rejects) => { | |
const api = 'https://api.chucknorris.io/jokes/random'; | |
const request = new XMLHttpRequest(); | |
request.open('GET', api); | |
request.onload = () => { | |
if (request.status === 200) { | |
resolves(JSON.parse(request.response)); | |
} else { | |
rejects(new Error(request.response)); |
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
fetch('https://api.chucknorris.io/jokes/random') | |
.then(res => res.json()) | |
.then(console.log); |
OlderNewer