What do you want to save?
Add Code snippet
New code examples
-
Javascript 2022-03-27 07:05:02
queue data structure in javascript 2018
var Queue = (()=>{ const map = new WeakMap(); let _items = [] class Queue{ constructor(...items){ //initialize the items in queue map.set(this, []); _items = map.get(this); // enqueuing the items passed to the construc... Add solution -
Html 2022-03-24 15:55:29
google map html
<script> function myMap() { var mapProp= { center:new google.maps.LatLng(51.508742,-0.120850), zoom:5, }; var map = new google.maps.Map(document.getElementById("googleMap"),mapProp); } </script> <script src="[Google API ... Add solution -
Javascript 2022-02-24 19:40:09
javascript hashmap
let contacts = new Map() contacts.set('Jessie', {phone: "213-555-1234", address: "123 N 1st Ave"}) contacts.has('Jessie') // true contacts.get('Hilary') // undefined contacts.set('Hilary', {phone: "617-555-4321", address: &qu... Add solution -
Other 2022-02-03 00:15:12
js return unique values from array of objects
const array = [ { id: 3, name: 'Central Microscopy', fiscalYear: 2018 }, { id: 5, name: 'Crystallography Facility', fiscalYear: 2018 }, { id: 3, name: 'Central Microscopy', fiscalYear: 2017 }, { id: 5, name: 'Crystallography Facility', fiscalY... Add solution -
Javascript 2022-02-02 23:01:05
multiple async api calls javascript
// store urls to fetch in an array const urls = [ 'https://dog.ceo/api/breeds/list', 'https://dog.ceo/api/breeds/image/random' ]; // use map() to perform a fetch and handle the response for each url Promise.all(urls.map(url => fetch(url) .th... Add solution -
Python 2022-01-31 23:15:04
how to convert tuple to int in python
# initialize tuple test_tuple = (1, 4, 5) # printing original tuple print("The original tuple : " + str(test_tuple)) # Convert Tuple to integer # Using int() + join() + map() res = int(''.join(map(str, test_tuple))) # printing r... Add solution -
Other 2022-01-31 07:50:53
Given an array of integers, every element appears thrice except for one which occurs once.
let contacts = new Map() contacts.set('Jessie', {phone: "213-555-1234", address: "123 N 1st Ave"}) contacts.has('Jessie') // true contacts.get('Hilary') // undefined contacts.set('Hilary', {phone: "617-555-4321", address: &qu... Add solution