This file contains hidden or 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
export const getUserLocation () { | |
const userAllowedToGetLocation = askUserPermission(); | |
if (userAllowedToGetLocation) { | |
return userLocation(); | |
} | |
else { | |
throw new Error('User refused to provide location'); | |
} | |
} |
This file contains hidden or 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 getMessage = (name) => { | |
return 'Hello my name is ' + name; | |
} |
This file contains hidden or 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 message = getMessage('Sam'); | |
function getMessage (name) { | |
const completeMessage = intro + ' ' + name; | |
const intro = 'Hello my name is'; | |
return completeMessage; | |
} | |
console.log('Message: ', message); |
This file contains hidden or 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 message; | |
function getMessage (name) { | |
var completeMessage; | |
var intro; | |
completeMessage = intro + ' ' + name; | |
intro = 'Hello my name is'; | |
return completeMessage; | |
} |
This file contains hidden or 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 message = getMessage('Sam'); | |
function getMessage (name) { | |
var completeMessage = intro + ' ' + name; | |
var intro = 'Hello my name is'; | |
return completeMessage; | |
} | |
console.log('Message: ', message); |
This file contains hidden or 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 message = getMessage('Sam'); | |
console.log(message); | |
function getMessage (name) { | |
return 'Hello my name is ' + name; | |
} |
This file contains hidden or 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
console.log('Hello, my name is ', somethingElse); | |
var name = 'Sam'; |
This file contains hidden or 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
console.log('Hello, my name is ', name); | |
var name = 'Sam'; |
This file contains hidden or 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 | |
$data = getDataFromDatabase(); | |
// Let's output the $data variable's content | |
var_dump($data); | |
// Let's output the result of calling json_encode | |
$encoded = json_encode($data); | |
var_dump($encoded); |
This file contains hidden or 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 | |
$data = getDataFromDatabase(); | |
// Let's output the $data variable's content | |
var_dump($data); | |
echo json_encode($data); | |
?> |
NewerOlder