JSFiddle - React, Tailwind, and code Playground
by itsazzad
JavaScript
const obj = {
Ringing: {
text: 'Ringing...',
actions: [
[
'End',
],
]
},
Incoming: {
text: 'Incoming...',
actions: [
[
'Mute',
'End',
'Message',
'Accept',
],
]
},
Connecting: {
text: 'Connecting...',
actions: [
[
'Mute',
'End',
'Message',
],
]
},
Reconnecting: {
text: 'Reconnecting...',
actions: [
[
'Mute',
'End',
'Message',
],
]
},
Answering: {
text: 'Answering...',
actions: [
[
'Mute',
'End',
'Message',
],
]
},
InCall: {
text: 'InCall',
actions: [
[
'Mute',
'Message',
],
[
'End',
]
]
},
GagaGuguVideo: {
text: 'GagaGuguVideo',
actions: [
[
'Mute',
'End',
'Message',
],
]
},
};
var myMap = new Map(Object.entries(obj));
console.log(myMap);
var keyString = 'a string',
keyObj = {},
keyFunc = function() {};
// setting the values
myMap.set(keyString, "value associated with 'a string'");
myMap.set(keyObj, 'value associated with keyObj');
myMap.set(keyFunc, 'value associated with keyFunc');
console.log(myMap);