Answers for "js map size"

1

size of map with no elements

#include <iostream>
#include <utility>
#include <map>

using namespace std;

int main(void)
{
    map<int, int> m;
    cout << m.size();
}

//Output: 0
Posted by: Guest on January-06-2021
1

js map size

const map1 = new Map();

map1.set('a', 'alpha');
map1.set('b', 'beta');
map1.set('g', 'gamma');

console.log(map1.size);
// expected output: 3
Posted by: Guest on March-15-2021

Code answers related to "Javascript"

Browse Popular Code Answers by Language