How to map an array to a date?
In C#, I would use the following Dictionary
Dictionary << Date, int >>
for having an array bound to a particular date. What would be the simplest way in JS to achieve the same?
I need to be able to alter the values in the integer array.
javascript arrays
add a comment |
In C#, I would use the following Dictionary
Dictionary << Date, int >>
for having an array bound to a particular date. What would be the simplest way in JS to achieve the same?
I need to be able to alter the values in the integer array.
javascript arrays
you can create something almost the same in JS. : stackoverflow.com/questions/7196212/…
– Budyn
Nov 12 '18 at 16:34
You can use the JavaScriptMap
class, but be warned that equality comparison for Map keys is less flexible than in Java (and I would strongly suspect C#).
– Pointy
Nov 12 '18 at 16:34
1
just remember IE 8 < does not support Map function
– Budyn
Nov 12 '18 at 16:35
add a comment |
In C#, I would use the following Dictionary
Dictionary << Date, int >>
for having an array bound to a particular date. What would be the simplest way in JS to achieve the same?
I need to be able to alter the values in the integer array.
javascript arrays
In C#, I would use the following Dictionary
Dictionary << Date, int >>
for having an array bound to a particular date. What would be the simplest way in JS to achieve the same?
I need to be able to alter the values in the integer array.
javascript arrays
javascript arrays
edited Nov 12 '18 at 16:43
John V
asked Nov 12 '18 at 16:32
John VJohn V
1,95782546
1,95782546
you can create something almost the same in JS. : stackoverflow.com/questions/7196212/…
– Budyn
Nov 12 '18 at 16:34
You can use the JavaScriptMap
class, but be warned that equality comparison for Map keys is less flexible than in Java (and I would strongly suspect C#).
– Pointy
Nov 12 '18 at 16:34
1
just remember IE 8 < does not support Map function
– Budyn
Nov 12 '18 at 16:35
add a comment |
you can create something almost the same in JS. : stackoverflow.com/questions/7196212/…
– Budyn
Nov 12 '18 at 16:34
You can use the JavaScriptMap
class, but be warned that equality comparison for Map keys is less flexible than in Java (and I would strongly suspect C#).
– Pointy
Nov 12 '18 at 16:34
1
just remember IE 8 < does not support Map function
– Budyn
Nov 12 '18 at 16:35
you can create something almost the same in JS. : stackoverflow.com/questions/7196212/…
– Budyn
Nov 12 '18 at 16:34
you can create something almost the same in JS. : stackoverflow.com/questions/7196212/…
– Budyn
Nov 12 '18 at 16:34
You can use the JavaScript
Map
class, but be warned that equality comparison for Map keys is less flexible than in Java (and I would strongly suspect C#).– Pointy
Nov 12 '18 at 16:34
You can use the JavaScript
Map
class, but be warned that equality comparison for Map keys is less flexible than in Java (and I would strongly suspect C#).– Pointy
Nov 12 '18 at 16:34
1
1
just remember IE 8 < does not support Map function
– Budyn
Nov 12 '18 at 16:35
just remember IE 8 < does not support Map function
– Budyn
Nov 12 '18 at 16:35
add a comment |
3 Answers
3
active
oldest
votes
You can achieve an equal behaviour in Js in various ways.
Dicitionary
could be replaced by a Map
, or just an object () with dynamic keys, however if you use an object you can only use strings as keys, anything else will be converted to a string. There is also a
Date
object in JS, however two dates representing the same date in time do not match:
const a = new Date(0), b = new Date(0);
console.log(a === b); // false
therefore they would not get stored in the same entry in the Map. Instead you could just stringify the Date, as strings are conpared by value. the int
would just be an array of numbers in js.
const date1 = new Date(0);
const date1b = new Date(0);
const obj = ;
const map = new Map;
obj[date1] = [1, 2, 3];
// equals:
obj[date1.toString()] = [1, 2, 3];
map.set(date1, [1, 2, 3]);
map.set(date1.toString(), [3, 4, 5]);
console.log(
obj[date1b], // [1, 2, 3]
map.get(date1b), // undefined
map.get(date1b.toString()), // [3, 4, 5]
);
I only need to group by days
In that case, you'd have to generate a number or string out of the Date that only contains the day:
(new Date()).toString().split("T")[0] // 2018-12-11
Then use that string as the Maps / objects key.
I retrieve dates from the database and using Moment when storing them.
– John V
Nov 12 '18 at 16:45
@John then i guess the timestamp is already a string (or a number?) in that case just take that.
– Jonas Wilms
Nov 12 '18 at 16:47
May I ask - I realized the date is also saved with its time component but I only need to group by days, how can I only use the date component? I guess otherwise I will never have two records under the same key as the milliseconds will not match :)
– John V
Nov 12 '18 at 16:51
@john V ah okay, I'll edit
– Jonas Wilms
Nov 12 '18 at 17:03
add a comment |
Use the timestamp of that date as a key for a js object.
For example, let's say you want to map date a to array b:
const a = new Date();
const b = [1, 2, 3];
const c =
[a.getTime()]: b,
;
in this case, c would be an object or hash map from date to array.
1
In particular with Date instances this is not a bad idea, because the timestamp comparison is reliable and works with different Date instances. That's probably more like what the OP would expect.
– Pointy
Nov 12 '18 at 16:36
add a comment |
Since you mentioned you are using momentjs
, you could use the moment unix
or toDate().getTime()
to to get the date in ms
and then utilize either an object or Map
to get what you need:
let date1 = moment().unix()
let date2 = moment().add(7, 'days').unix()
let dict = // using object
dict[date1] = [1,2,3]
dict[date2] = [4,5,6]
console.log('dict via Object', dict[date1], dict[date2])
let dict2 = new Map() // using Map
dict2.set(date1, [1,2,3])
dict2.set(date2, [4,5,6])
console.log('dict via Map', dict2.get(date1), dict2.get(date2))
<script src="https://cdnjs.cloudflare.com/ajax/libs/moment.js/2.22.2/moment.min.js"></script>
1
you have a small typo ongetTime
– rubentd
Nov 12 '18 at 17:09
1
Thanks :). Fixed
– Akrion
Nov 12 '18 at 17:10
add a comment |
Your Answer
StackExchange.ifUsing("editor", function ()
StackExchange.using("externalEditor", function ()
StackExchange.using("snippets", function ()
StackExchange.snippets.init();
);
);
, "code-snippets");
StackExchange.ready(function()
var channelOptions =
tags: "".split(" "),
id: "1"
;
initTagRenderer("".split(" "), "".split(" "), channelOptions);
StackExchange.using("externalEditor", function()
// Have to fire editor after snippets, if snippets enabled
if (StackExchange.settings.snippets.snippetsEnabled)
StackExchange.using("snippets", function()
createEditor();
);
else
createEditor();
);
function createEditor()
StackExchange.prepareEditor(
heartbeatType: 'answer',
autoActivateHeartbeat: false,
convertImagesToLinks: true,
noModals: true,
showLowRepImageUploadWarning: true,
reputationToPostImages: 10,
bindNavPrevention: true,
postfix: "",
imageUploader:
brandingHtml: "Powered by u003ca class="icon-imgur-white" href="https://imgur.com/"u003eu003c/au003e",
contentPolicyHtml: "User contributions licensed under u003ca href="https://creativecommons.org/licenses/by-sa/3.0/"u003ecc by-sa 3.0 with attribution requiredu003c/au003e u003ca href="https://stackoverflow.com/legal/content-policy"u003e(content policy)u003c/au003e",
allowUrls: true
,
onDemand: true,
discardSelector: ".discard-answer"
,immediatelyShowMarkdownHelp:true
);
);
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
StackExchange.ready(
function ()
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f53266402%2fhow-to-map-an-array-to-a-date%23new-answer', 'question_page');
);
Post as a guest
Required, but never shown
3 Answers
3
active
oldest
votes
3 Answers
3
active
oldest
votes
active
oldest
votes
active
oldest
votes
You can achieve an equal behaviour in Js in various ways.
Dicitionary
could be replaced by a Map
, or just an object () with dynamic keys, however if you use an object you can only use strings as keys, anything else will be converted to a string. There is also a
Date
object in JS, however two dates representing the same date in time do not match:
const a = new Date(0), b = new Date(0);
console.log(a === b); // false
therefore they would not get stored in the same entry in the Map. Instead you could just stringify the Date, as strings are conpared by value. the int
would just be an array of numbers in js.
const date1 = new Date(0);
const date1b = new Date(0);
const obj = ;
const map = new Map;
obj[date1] = [1, 2, 3];
// equals:
obj[date1.toString()] = [1, 2, 3];
map.set(date1, [1, 2, 3]);
map.set(date1.toString(), [3, 4, 5]);
console.log(
obj[date1b], // [1, 2, 3]
map.get(date1b), // undefined
map.get(date1b.toString()), // [3, 4, 5]
);
I only need to group by days
In that case, you'd have to generate a number or string out of the Date that only contains the day:
(new Date()).toString().split("T")[0] // 2018-12-11
Then use that string as the Maps / objects key.
I retrieve dates from the database and using Moment when storing them.
– John V
Nov 12 '18 at 16:45
@John then i guess the timestamp is already a string (or a number?) in that case just take that.
– Jonas Wilms
Nov 12 '18 at 16:47
May I ask - I realized the date is also saved with its time component but I only need to group by days, how can I only use the date component? I guess otherwise I will never have two records under the same key as the milliseconds will not match :)
– John V
Nov 12 '18 at 16:51
@john V ah okay, I'll edit
– Jonas Wilms
Nov 12 '18 at 17:03
add a comment |
You can achieve an equal behaviour in Js in various ways.
Dicitionary
could be replaced by a Map
, or just an object () with dynamic keys, however if you use an object you can only use strings as keys, anything else will be converted to a string. There is also a
Date
object in JS, however two dates representing the same date in time do not match:
const a = new Date(0), b = new Date(0);
console.log(a === b); // false
therefore they would not get stored in the same entry in the Map. Instead you could just stringify the Date, as strings are conpared by value. the int
would just be an array of numbers in js.
const date1 = new Date(0);
const date1b = new Date(0);
const obj = ;
const map = new Map;
obj[date1] = [1, 2, 3];
// equals:
obj[date1.toString()] = [1, 2, 3];
map.set(date1, [1, 2, 3]);
map.set(date1.toString(), [3, 4, 5]);
console.log(
obj[date1b], // [1, 2, 3]
map.get(date1b), // undefined
map.get(date1b.toString()), // [3, 4, 5]
);
I only need to group by days
In that case, you'd have to generate a number or string out of the Date that only contains the day:
(new Date()).toString().split("T")[0] // 2018-12-11
Then use that string as the Maps / objects key.
I retrieve dates from the database and using Moment when storing them.
– John V
Nov 12 '18 at 16:45
@John then i guess the timestamp is already a string (or a number?) in that case just take that.
– Jonas Wilms
Nov 12 '18 at 16:47
May I ask - I realized the date is also saved with its time component but I only need to group by days, how can I only use the date component? I guess otherwise I will never have two records under the same key as the milliseconds will not match :)
– John V
Nov 12 '18 at 16:51
@john V ah okay, I'll edit
– Jonas Wilms
Nov 12 '18 at 17:03
add a comment |
You can achieve an equal behaviour in Js in various ways.
Dicitionary
could be replaced by a Map
, or just an object () with dynamic keys, however if you use an object you can only use strings as keys, anything else will be converted to a string. There is also a
Date
object in JS, however two dates representing the same date in time do not match:
const a = new Date(0), b = new Date(0);
console.log(a === b); // false
therefore they would not get stored in the same entry in the Map. Instead you could just stringify the Date, as strings are conpared by value. the int
would just be an array of numbers in js.
const date1 = new Date(0);
const date1b = new Date(0);
const obj = ;
const map = new Map;
obj[date1] = [1, 2, 3];
// equals:
obj[date1.toString()] = [1, 2, 3];
map.set(date1, [1, 2, 3]);
map.set(date1.toString(), [3, 4, 5]);
console.log(
obj[date1b], // [1, 2, 3]
map.get(date1b), // undefined
map.get(date1b.toString()), // [3, 4, 5]
);
I only need to group by days
In that case, you'd have to generate a number or string out of the Date that only contains the day:
(new Date()).toString().split("T")[0] // 2018-12-11
Then use that string as the Maps / objects key.
You can achieve an equal behaviour in Js in various ways.
Dicitionary
could be replaced by a Map
, or just an object () with dynamic keys, however if you use an object you can only use strings as keys, anything else will be converted to a string. There is also a
Date
object in JS, however two dates representing the same date in time do not match:
const a = new Date(0), b = new Date(0);
console.log(a === b); // false
therefore they would not get stored in the same entry in the Map. Instead you could just stringify the Date, as strings are conpared by value. the int
would just be an array of numbers in js.
const date1 = new Date(0);
const date1b = new Date(0);
const obj = ;
const map = new Map;
obj[date1] = [1, 2, 3];
// equals:
obj[date1.toString()] = [1, 2, 3];
map.set(date1, [1, 2, 3]);
map.set(date1.toString(), [3, 4, 5]);
console.log(
obj[date1b], // [1, 2, 3]
map.get(date1b), // undefined
map.get(date1b.toString()), // [3, 4, 5]
);
I only need to group by days
In that case, you'd have to generate a number or string out of the Date that only contains the day:
(new Date()).toString().split("T")[0] // 2018-12-11
Then use that string as the Maps / objects key.
edited Nov 12 '18 at 17:05
answered Nov 12 '18 at 16:43
Jonas WilmsJonas Wilms
56.4k42851
56.4k42851
I retrieve dates from the database and using Moment when storing them.
– John V
Nov 12 '18 at 16:45
@John then i guess the timestamp is already a string (or a number?) in that case just take that.
– Jonas Wilms
Nov 12 '18 at 16:47
May I ask - I realized the date is also saved with its time component but I only need to group by days, how can I only use the date component? I guess otherwise I will never have two records under the same key as the milliseconds will not match :)
– John V
Nov 12 '18 at 16:51
@john V ah okay, I'll edit
– Jonas Wilms
Nov 12 '18 at 17:03
add a comment |
I retrieve dates from the database and using Moment when storing them.
– John V
Nov 12 '18 at 16:45
@John then i guess the timestamp is already a string (or a number?) in that case just take that.
– Jonas Wilms
Nov 12 '18 at 16:47
May I ask - I realized the date is also saved with its time component but I only need to group by days, how can I only use the date component? I guess otherwise I will never have two records under the same key as the milliseconds will not match :)
– John V
Nov 12 '18 at 16:51
@john V ah okay, I'll edit
– Jonas Wilms
Nov 12 '18 at 17:03
I retrieve dates from the database and using Moment when storing them.
– John V
Nov 12 '18 at 16:45
I retrieve dates from the database and using Moment when storing them.
– John V
Nov 12 '18 at 16:45
@John then i guess the timestamp is already a string (or a number?) in that case just take that.
– Jonas Wilms
Nov 12 '18 at 16:47
@John then i guess the timestamp is already a string (or a number?) in that case just take that.
– Jonas Wilms
Nov 12 '18 at 16:47
May I ask - I realized the date is also saved with its time component but I only need to group by days, how can I only use the date component? I guess otherwise I will never have two records under the same key as the milliseconds will not match :)
– John V
Nov 12 '18 at 16:51
May I ask - I realized the date is also saved with its time component but I only need to group by days, how can I only use the date component? I guess otherwise I will never have two records under the same key as the milliseconds will not match :)
– John V
Nov 12 '18 at 16:51
@john V ah okay, I'll edit
– Jonas Wilms
Nov 12 '18 at 17:03
@john V ah okay, I'll edit
– Jonas Wilms
Nov 12 '18 at 17:03
add a comment |
Use the timestamp of that date as a key for a js object.
For example, let's say you want to map date a to array b:
const a = new Date();
const b = [1, 2, 3];
const c =
[a.getTime()]: b,
;
in this case, c would be an object or hash map from date to array.
1
In particular with Date instances this is not a bad idea, because the timestamp comparison is reliable and works with different Date instances. That's probably more like what the OP would expect.
– Pointy
Nov 12 '18 at 16:36
add a comment |
Use the timestamp of that date as a key for a js object.
For example, let's say you want to map date a to array b:
const a = new Date();
const b = [1, 2, 3];
const c =
[a.getTime()]: b,
;
in this case, c would be an object or hash map from date to array.
1
In particular with Date instances this is not a bad idea, because the timestamp comparison is reliable and works with different Date instances. That's probably more like what the OP would expect.
– Pointy
Nov 12 '18 at 16:36
add a comment |
Use the timestamp of that date as a key for a js object.
For example, let's say you want to map date a to array b:
const a = new Date();
const b = [1, 2, 3];
const c =
[a.getTime()]: b,
;
in this case, c would be an object or hash map from date to array.
Use the timestamp of that date as a key for a js object.
For example, let's say you want to map date a to array b:
const a = new Date();
const b = [1, 2, 3];
const c =
[a.getTime()]: b,
;
in this case, c would be an object or hash map from date to array.
const a = new Date();
const b = [1, 2, 3];
const c =
[a.getTime()]: b,
;
const a = new Date();
const b = [1, 2, 3];
const c =
[a.getTime()]: b,
;
edited Nov 12 '18 at 16:37
answered Nov 12 '18 at 16:35
rubentdrubentd
1,077821
1,077821
1
In particular with Date instances this is not a bad idea, because the timestamp comparison is reliable and works with different Date instances. That's probably more like what the OP would expect.
– Pointy
Nov 12 '18 at 16:36
add a comment |
1
In particular with Date instances this is not a bad idea, because the timestamp comparison is reliable and works with different Date instances. That's probably more like what the OP would expect.
– Pointy
Nov 12 '18 at 16:36
1
1
In particular with Date instances this is not a bad idea, because the timestamp comparison is reliable and works with different Date instances. That's probably more like what the OP would expect.
– Pointy
Nov 12 '18 at 16:36
In particular with Date instances this is not a bad idea, because the timestamp comparison is reliable and works with different Date instances. That's probably more like what the OP would expect.
– Pointy
Nov 12 '18 at 16:36
add a comment |
Since you mentioned you are using momentjs
, you could use the moment unix
or toDate().getTime()
to to get the date in ms
and then utilize either an object or Map
to get what you need:
let date1 = moment().unix()
let date2 = moment().add(7, 'days').unix()
let dict = // using object
dict[date1] = [1,2,3]
dict[date2] = [4,5,6]
console.log('dict via Object', dict[date1], dict[date2])
let dict2 = new Map() // using Map
dict2.set(date1, [1,2,3])
dict2.set(date2, [4,5,6])
console.log('dict via Map', dict2.get(date1), dict2.get(date2))
<script src="https://cdnjs.cloudflare.com/ajax/libs/moment.js/2.22.2/moment.min.js"></script>
1
you have a small typo ongetTime
– rubentd
Nov 12 '18 at 17:09
1
Thanks :). Fixed
– Akrion
Nov 12 '18 at 17:10
add a comment |
Since you mentioned you are using momentjs
, you could use the moment unix
or toDate().getTime()
to to get the date in ms
and then utilize either an object or Map
to get what you need:
let date1 = moment().unix()
let date2 = moment().add(7, 'days').unix()
let dict = // using object
dict[date1] = [1,2,3]
dict[date2] = [4,5,6]
console.log('dict via Object', dict[date1], dict[date2])
let dict2 = new Map() // using Map
dict2.set(date1, [1,2,3])
dict2.set(date2, [4,5,6])
console.log('dict via Map', dict2.get(date1), dict2.get(date2))
<script src="https://cdnjs.cloudflare.com/ajax/libs/moment.js/2.22.2/moment.min.js"></script>
1
you have a small typo ongetTime
– rubentd
Nov 12 '18 at 17:09
1
Thanks :). Fixed
– Akrion
Nov 12 '18 at 17:10
add a comment |
Since you mentioned you are using momentjs
, you could use the moment unix
or toDate().getTime()
to to get the date in ms
and then utilize either an object or Map
to get what you need:
let date1 = moment().unix()
let date2 = moment().add(7, 'days').unix()
let dict = // using object
dict[date1] = [1,2,3]
dict[date2] = [4,5,6]
console.log('dict via Object', dict[date1], dict[date2])
let dict2 = new Map() // using Map
dict2.set(date1, [1,2,3])
dict2.set(date2, [4,5,6])
console.log('dict via Map', dict2.get(date1), dict2.get(date2))
<script src="https://cdnjs.cloudflare.com/ajax/libs/moment.js/2.22.2/moment.min.js"></script>
Since you mentioned you are using momentjs
, you could use the moment unix
or toDate().getTime()
to to get the date in ms
and then utilize either an object or Map
to get what you need:
let date1 = moment().unix()
let date2 = moment().add(7, 'days').unix()
let dict = // using object
dict[date1] = [1,2,3]
dict[date2] = [4,5,6]
console.log('dict via Object', dict[date1], dict[date2])
let dict2 = new Map() // using Map
dict2.set(date1, [1,2,3])
dict2.set(date2, [4,5,6])
console.log('dict via Map', dict2.get(date1), dict2.get(date2))
<script src="https://cdnjs.cloudflare.com/ajax/libs/moment.js/2.22.2/moment.min.js"></script>
let date1 = moment().unix()
let date2 = moment().add(7, 'days').unix()
let dict = // using object
dict[date1] = [1,2,3]
dict[date2] = [4,5,6]
console.log('dict via Object', dict[date1], dict[date2])
let dict2 = new Map() // using Map
dict2.set(date1, [1,2,3])
dict2.set(date2, [4,5,6])
console.log('dict via Map', dict2.get(date1), dict2.get(date2))
<script src="https://cdnjs.cloudflare.com/ajax/libs/moment.js/2.22.2/moment.min.js"></script>
let date1 = moment().unix()
let date2 = moment().add(7, 'days').unix()
let dict = // using object
dict[date1] = [1,2,3]
dict[date2] = [4,5,6]
console.log('dict via Object', dict[date1], dict[date2])
let dict2 = new Map() // using Map
dict2.set(date1, [1,2,3])
dict2.set(date2, [4,5,6])
console.log('dict via Map', dict2.get(date1), dict2.get(date2))
<script src="https://cdnjs.cloudflare.com/ajax/libs/moment.js/2.22.2/moment.min.js"></script>
edited Nov 12 '18 at 17:10
answered Nov 12 '18 at 17:03
AkrionAkrion
9,40211224
9,40211224
1
you have a small typo ongetTime
– rubentd
Nov 12 '18 at 17:09
1
Thanks :). Fixed
– Akrion
Nov 12 '18 at 17:10
add a comment |
1
you have a small typo ongetTime
– rubentd
Nov 12 '18 at 17:09
1
Thanks :). Fixed
– Akrion
Nov 12 '18 at 17:10
1
1
you have a small typo on
getTime
– rubentd
Nov 12 '18 at 17:09
you have a small typo on
getTime
– rubentd
Nov 12 '18 at 17:09
1
1
Thanks :). Fixed
– Akrion
Nov 12 '18 at 17:10
Thanks :). Fixed
– Akrion
Nov 12 '18 at 17:10
add a comment |
Thanks for contributing an answer to Stack Overflow!
- Please be sure to answer the question. Provide details and share your research!
But avoid …
- Asking for help, clarification, or responding to other answers.
- Making statements based on opinion; back them up with references or personal experience.
To learn more, see our tips on writing great answers.
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
StackExchange.ready(
function ()
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f53266402%2fhow-to-map-an-array-to-a-date%23new-answer', 'question_page');
);
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
you can create something almost the same in JS. : stackoverflow.com/questions/7196212/…
– Budyn
Nov 12 '18 at 16:34
You can use the JavaScript
Map
class, but be warned that equality comparison for Map keys is less flexible than in Java (and I would strongly suspect C#).– Pointy
Nov 12 '18 at 16:34
1
just remember IE 8 < does not support Map function
– Budyn
Nov 12 '18 at 16:35