I hereby claim:
- I am nyagarcia on github.
- I am nyachan (https://keybase.io/nyachan) on keybase.
- I have a public key ASCX_KYHXdj9trZ43Hq4aShjNWxZxVQ-XNDJM8IMc9sV1go
To claim this, I am signing this object:
version: "3.1" | |
services: | |
db: | |
container_name: mongoDB | |
image: mongo:latest | |
restart: always | |
volumes: | |
- ./pokeData:/data/db | |
environment: |
function getCalculatedRoutes(routes: Array<any>): Promise<any> { | |
return Promise.all( | |
routes.map(async (route: any) => { | |
const distance = await getDistance(); | |
route.distance = distance; | |
route.cost = calculateCost(distance); | |
return route; | |
}) | |
); | |
} |
version: '3.1' | |
services: | |
db: | |
container_name: Mongo-db | |
image: mongo:latest | |
restart: always | |
volumes: | |
- ./myData:/data/db | |
env_file: |
version: '3.1' | |
services: | |
db: | |
container_name: Mongo-db | |
image: mongo:latest | |
restart: always | |
volumes: | |
- ./myData:/data/db | |
environment: |
version: '3.1' | |
services: | |
db: | |
container_name: Mongo-db | |
image: mongo:latest | |
restart: always | |
volumes: | |
- ./myData:/data/db | |
environment: |
I hereby claim:
To claim this, I am signing this object:
function dynamicDestructureMany(object, properties) { | |
return properties.map(property => { | |
const { [property]: value } = object; | |
return value; | |
}); | |
} | |
console.log(dynamicDestructureMany(pokemon, ['name', 'type'])); //Result: ['Squirtle', 'Water'] |
const pokemon = { | |
id: 1, | |
name: 'Squirtle', | |
type: 'Water' | |
}; | |
const { id, ...rest } = pokemon; | |
console.log(rest); //Result: { name: 'Squirtle', type: 'Water' } |
const pokemon = { | |
name: 'Squirtle', | |
type: 'Water', | |
abilities: ['Torrent', 'Rain Dish'] | |
}; | |
const { abilities = [], ...rest } = pokemon; | |
const fullSquirtle = { ...rest, abilities }; | |
console.log(rest); //Result: { name: 'Squirtle', type: 'Water' } |
const pokemon = { | |
id: 1, | |
name: 'Squirtle' | |
}; | |
const { type, name } = pokemon; | |
console.log(name); //Result: Squirtle | |
console.log(type); //Result: undefined | |
//Assigning default value to the type variable |