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
<ion-header> | |
<ion-toolbar> | |
<ion-title> | |
Access Location | |
</ion-title> | |
</ion-toolbar> | |
</ion-header> | |
<ion-content> | |
<ion-item style="cursor: pointer;margin-top:100px;" (click)="onpickupClick()"> | |
<ion-icon slot="start" name="locate"></ion-icon> |
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 getInfo = (json) => { | |
const obj = JSON.parse(json); | |
const name = getName(obj); | |
const id = getAge(obj); | |
const rollNumber = getRollNumber(obj); | |
return `The student name is ${name} and id is ${id + rollNumber}`; | |
} | |
const json = '{"firstName": "Vivek","lastName": "Bisht", |
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
The student name is VivekBisht and id is function () { return 30; }3451 |
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 targetObj = { | |
name: "Ryan", | |
age: 34 | |
}; |
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 proxyObj = new Proxy(targetObj, handler); |
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 handler = { | |
get: function(target, property){ | |
}, | |
set: function(target, property, value){ | |
} | |
}; |
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 handler = { | |
get: function(target,property) { | |
if(property === "name"){ | |
return `Name of the person is ${target[property]}` | |
} | |
}, | |
} |
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 handler = { | |
set: function (target, property, value){ | |
if(property === "age"){ | |
if(typeof value == "string"){ | |
alert("Cannot assign String to age, use Number only"); | |
} | |
else{ | |
target[property] = value; | |
} | |
} |
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 proxyObj = new Proxy(getTargetObj(), handler); |
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 handler = { | |
get: async (target, date) => { | |
if(target[date]){ | |
return target[date]; | |
} | |
else{ | |
const dataRaw = await fetch(`https://api.nasa.gov/planetary/apod?api_key=${apiKey}&date=${date}`, { | |
method : "GET", | |
mode: 'cors', | |
}); |
OlderNewer