Modify javascript forEach result with value from another Array
I want to modify the following forEach result with values from another array but I can't get it working.
const BbDescriptionDictionary = ['AAA' , 'BBB', 'CCC',]
const boardBasisOptionsModified = ;
this.boardBasisOptions.forEach( (value) => {
boardBasisOptionsModified.push({
"key": value, "value": BbDescriptionDictionary[value]
});
});
this.boardBasisOptions = boardBasisOptionsModified;
javascript angular
add a comment |
I want to modify the following forEach result with values from another array but I can't get it working.
const BbDescriptionDictionary = ['AAA' , 'BBB', 'CCC',]
const boardBasisOptionsModified = ;
this.boardBasisOptions.forEach( (value) => {
boardBasisOptionsModified.push({
"key": value, "value": BbDescriptionDictionary[value]
});
});
this.boardBasisOptions = boardBasisOptionsModified;
javascript angular
what isboardBasisOptions
?
– Pardeep Jain
Nov 22 at 10:38
btw, your dictionary is an array, that means you access it with an index, not a value.
– Nina Scholz
Nov 22 at 10:39
value is an item in the array "boardBasisOptions"... while you should provide an indexNumber to "BbDescriptionDictionary[value]"...
– AIqbalRaj
Nov 22 at 10:40
1
You array works with indexes, not named properties. UsingBbDescriptionDictionary[value]
will translate toBbDescriptionDictionary['AAA']
, while it should beBbDescriptionDictionary[0]
.
– trichetriche
Nov 22 at 10:40
add a comment |
I want to modify the following forEach result with values from another array but I can't get it working.
const BbDescriptionDictionary = ['AAA' , 'BBB', 'CCC',]
const boardBasisOptionsModified = ;
this.boardBasisOptions.forEach( (value) => {
boardBasisOptionsModified.push({
"key": value, "value": BbDescriptionDictionary[value]
});
});
this.boardBasisOptions = boardBasisOptionsModified;
javascript angular
I want to modify the following forEach result with values from another array but I can't get it working.
const BbDescriptionDictionary = ['AAA' , 'BBB', 'CCC',]
const boardBasisOptionsModified = ;
this.boardBasisOptions.forEach( (value) => {
boardBasisOptionsModified.push({
"key": value, "value": BbDescriptionDictionary[value]
});
});
this.boardBasisOptions = boardBasisOptionsModified;
javascript angular
javascript angular
edited Nov 22 at 10:39
cyr-x
7,118932
7,118932
asked Nov 22 at 10:36
olootu
2416
2416
what isboardBasisOptions
?
– Pardeep Jain
Nov 22 at 10:38
btw, your dictionary is an array, that means you access it with an index, not a value.
– Nina Scholz
Nov 22 at 10:39
value is an item in the array "boardBasisOptions"... while you should provide an indexNumber to "BbDescriptionDictionary[value]"...
– AIqbalRaj
Nov 22 at 10:40
1
You array works with indexes, not named properties. UsingBbDescriptionDictionary[value]
will translate toBbDescriptionDictionary['AAA']
, while it should beBbDescriptionDictionary[0]
.
– trichetriche
Nov 22 at 10:40
add a comment |
what isboardBasisOptions
?
– Pardeep Jain
Nov 22 at 10:38
btw, your dictionary is an array, that means you access it with an index, not a value.
– Nina Scholz
Nov 22 at 10:39
value is an item in the array "boardBasisOptions"... while you should provide an indexNumber to "BbDescriptionDictionary[value]"...
– AIqbalRaj
Nov 22 at 10:40
1
You array works with indexes, not named properties. UsingBbDescriptionDictionary[value]
will translate toBbDescriptionDictionary['AAA']
, while it should beBbDescriptionDictionary[0]
.
– trichetriche
Nov 22 at 10:40
what is
boardBasisOptions
?– Pardeep Jain
Nov 22 at 10:38
what is
boardBasisOptions
?– Pardeep Jain
Nov 22 at 10:38
btw, your dictionary is an array, that means you access it with an index, not a value.
– Nina Scholz
Nov 22 at 10:39
btw, your dictionary is an array, that means you access it with an index, not a value.
– Nina Scholz
Nov 22 at 10:39
value is an item in the array "boardBasisOptions"... while you should provide an indexNumber to "BbDescriptionDictionary[value]"...
– AIqbalRaj
Nov 22 at 10:40
value is an item in the array "boardBasisOptions"... while you should provide an indexNumber to "BbDescriptionDictionary[value]"...
– AIqbalRaj
Nov 22 at 10:40
1
1
You array works with indexes, not named properties. Using
BbDescriptionDictionary[value]
will translate to BbDescriptionDictionary['AAA']
, while it should be BbDescriptionDictionary[0]
.– trichetriche
Nov 22 at 10:40
You array works with indexes, not named properties. Using
BbDescriptionDictionary[value]
will translate to BbDescriptionDictionary['AAA']
, while it should be BbDescriptionDictionary[0]
.– trichetriche
Nov 22 at 10:40
add a comment |
5 Answers
5
active
oldest
votes
You may want to add the index
parameter in your forEach
loop:
(I also initialized the boardBasisOptions
with some values)
See this working snippet:
boardBasisOptions = ['key1', 'key2', 'key3'];
const BbDescriptionDictionary = ['AAA', 'BBB', 'CCC', ]
const boardBasisOptionsModified = ;
this.boardBasisOptions.forEach((value, index) => {
boardBasisOptionsModified.push({
"key": value,
"value": BbDescriptionDictionary[index]
});
});
this.boardBasisOptions = boardBasisOptionsModified;
console.log("boardBasisOptions:");
console.log(this.boardBasisOptions);
For the sake of example you should logboardBasisOptionsModified
.
– Darren
Nov 22 at 10:42
@Darren I think there is no need, I already logboardBasisOptions
!
– Takit Isy
Nov 22 at 10:44
It works perfectly. Many thanks.
– olootu
Nov 22 at 10:58
add a comment |
You can give .forEach
a second parameter, indicating the index of boardBasisOptions
. Like this:
this.boardBasisOptions.forEach( (value, index) => {
boardBasisOptionsModified.push({
"key": value, "value": BbDescriptionDictionary[index]
});
});
add a comment |
You're trying to access the value inside your BbDescriptionDictionay
array using the value and not the index. You have to use the index to access the value of an array.
Just add index
as a second parameter of your forEach
function.
this.boardBasisOptions.forEach( (value, index) => {
boardBasisOptionsModified.push({
"key": value, "value": BbDescriptionDictionary[index]
});
});
add a comment |
By taking the index, you could use Array#map
instead of Array#push
.
const BbDescriptionDictionary = ['AAA', 'BBB', 'CCC',]
this.boardBasisOptions = this
.boardBasisOptions
.map((key, index) => ({ key, value: BbDescriptionDictionary[index] }));
add a comment |
You should just use Array.prototype.map()
to create a new, mutated array rather than worrying about creating temporary arrays, mutating them and then assigning them.
const BbDescriptionDictionary = ['AAA' , 'BBB', 'CCC',]
// Map runs the function on each array item and returns a new array
// with mutated the return value of that function
// Note: ({ ... }) is a shorthand way of returning a value
// (object in this case) without a function body {}
this.boardBasisOptions = this.boardBasisOptions.map((key, index) => ({
// Shorthand way of assigning a variable to an object using the var
// name as the key
key,
value: BbDescriptionDictionary[index]
})
Its is considered bad practice to override properties like this, so I would return the original boardBasisOptions
to a a new property and use that later on:
const BbDescriptionDictionary = ['AAA' , 'BBB', 'CCC',]
this.boardBasisOptionsWithDescriptions = this.boardBasisOptions.map((key, index) => ({
key,
value: BbDescriptionDictionary[index]
})
Hope that helps 👍
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%2f53429013%2fmodify-javascript-foreach-result-with-value-from-another-array%23new-answer', 'question_page');
}
);
Post as a guest
Required, but never shown
5 Answers
5
active
oldest
votes
5 Answers
5
active
oldest
votes
active
oldest
votes
active
oldest
votes
You may want to add the index
parameter in your forEach
loop:
(I also initialized the boardBasisOptions
with some values)
See this working snippet:
boardBasisOptions = ['key1', 'key2', 'key3'];
const BbDescriptionDictionary = ['AAA', 'BBB', 'CCC', ]
const boardBasisOptionsModified = ;
this.boardBasisOptions.forEach((value, index) => {
boardBasisOptionsModified.push({
"key": value,
"value": BbDescriptionDictionary[index]
});
});
this.boardBasisOptions = boardBasisOptionsModified;
console.log("boardBasisOptions:");
console.log(this.boardBasisOptions);
For the sake of example you should logboardBasisOptionsModified
.
– Darren
Nov 22 at 10:42
@Darren I think there is no need, I already logboardBasisOptions
!
– Takit Isy
Nov 22 at 10:44
It works perfectly. Many thanks.
– olootu
Nov 22 at 10:58
add a comment |
You may want to add the index
parameter in your forEach
loop:
(I also initialized the boardBasisOptions
with some values)
See this working snippet:
boardBasisOptions = ['key1', 'key2', 'key3'];
const BbDescriptionDictionary = ['AAA', 'BBB', 'CCC', ]
const boardBasisOptionsModified = ;
this.boardBasisOptions.forEach((value, index) => {
boardBasisOptionsModified.push({
"key": value,
"value": BbDescriptionDictionary[index]
});
});
this.boardBasisOptions = boardBasisOptionsModified;
console.log("boardBasisOptions:");
console.log(this.boardBasisOptions);
For the sake of example you should logboardBasisOptionsModified
.
– Darren
Nov 22 at 10:42
@Darren I think there is no need, I already logboardBasisOptions
!
– Takit Isy
Nov 22 at 10:44
It works perfectly. Many thanks.
– olootu
Nov 22 at 10:58
add a comment |
You may want to add the index
parameter in your forEach
loop:
(I also initialized the boardBasisOptions
with some values)
See this working snippet:
boardBasisOptions = ['key1', 'key2', 'key3'];
const BbDescriptionDictionary = ['AAA', 'BBB', 'CCC', ]
const boardBasisOptionsModified = ;
this.boardBasisOptions.forEach((value, index) => {
boardBasisOptionsModified.push({
"key": value,
"value": BbDescriptionDictionary[index]
});
});
this.boardBasisOptions = boardBasisOptionsModified;
console.log("boardBasisOptions:");
console.log(this.boardBasisOptions);
You may want to add the index
parameter in your forEach
loop:
(I also initialized the boardBasisOptions
with some values)
See this working snippet:
boardBasisOptions = ['key1', 'key2', 'key3'];
const BbDescriptionDictionary = ['AAA', 'BBB', 'CCC', ]
const boardBasisOptionsModified = ;
this.boardBasisOptions.forEach((value, index) => {
boardBasisOptionsModified.push({
"key": value,
"value": BbDescriptionDictionary[index]
});
});
this.boardBasisOptions = boardBasisOptionsModified;
console.log("boardBasisOptions:");
console.log(this.boardBasisOptions);
boardBasisOptions = ['key1', 'key2', 'key3'];
const BbDescriptionDictionary = ['AAA', 'BBB', 'CCC', ]
const boardBasisOptionsModified = ;
this.boardBasisOptions.forEach((value, index) => {
boardBasisOptionsModified.push({
"key": value,
"value": BbDescriptionDictionary[index]
});
});
this.boardBasisOptions = boardBasisOptionsModified;
console.log("boardBasisOptions:");
console.log(this.boardBasisOptions);
boardBasisOptions = ['key1', 'key2', 'key3'];
const BbDescriptionDictionary = ['AAA', 'BBB', 'CCC', ]
const boardBasisOptionsModified = ;
this.boardBasisOptions.forEach((value, index) => {
boardBasisOptionsModified.push({
"key": value,
"value": BbDescriptionDictionary[index]
});
});
this.boardBasisOptions = boardBasisOptionsModified;
console.log("boardBasisOptions:");
console.log(this.boardBasisOptions);
edited Nov 26 at 9:27
halfer
14.3k758108
14.3k758108
answered Nov 22 at 10:40
Takit Isy
6,0552930
6,0552930
For the sake of example you should logboardBasisOptionsModified
.
– Darren
Nov 22 at 10:42
@Darren I think there is no need, I already logboardBasisOptions
!
– Takit Isy
Nov 22 at 10:44
It works perfectly. Many thanks.
– olootu
Nov 22 at 10:58
add a comment |
For the sake of example you should logboardBasisOptionsModified
.
– Darren
Nov 22 at 10:42
@Darren I think there is no need, I already logboardBasisOptions
!
– Takit Isy
Nov 22 at 10:44
It works perfectly. Many thanks.
– olootu
Nov 22 at 10:58
For the sake of example you should log
boardBasisOptionsModified
.– Darren
Nov 22 at 10:42
For the sake of example you should log
boardBasisOptionsModified
.– Darren
Nov 22 at 10:42
@Darren I think there is no need, I already log
boardBasisOptions
!– Takit Isy
Nov 22 at 10:44
@Darren I think there is no need, I already log
boardBasisOptions
!– Takit Isy
Nov 22 at 10:44
It works perfectly. Many thanks.
– olootu
Nov 22 at 10:58
It works perfectly. Many thanks.
– olootu
Nov 22 at 10:58
add a comment |
You can give .forEach
a second parameter, indicating the index of boardBasisOptions
. Like this:
this.boardBasisOptions.forEach( (value, index) => {
boardBasisOptionsModified.push({
"key": value, "value": BbDescriptionDictionary[index]
});
});
add a comment |
You can give .forEach
a second parameter, indicating the index of boardBasisOptions
. Like this:
this.boardBasisOptions.forEach( (value, index) => {
boardBasisOptionsModified.push({
"key": value, "value": BbDescriptionDictionary[index]
});
});
add a comment |
You can give .forEach
a second parameter, indicating the index of boardBasisOptions
. Like this:
this.boardBasisOptions.forEach( (value, index) => {
boardBasisOptionsModified.push({
"key": value, "value": BbDescriptionDictionary[index]
});
});
You can give .forEach
a second parameter, indicating the index of boardBasisOptions
. Like this:
this.boardBasisOptions.forEach( (value, index) => {
boardBasisOptionsModified.push({
"key": value, "value": BbDescriptionDictionary[index]
});
});
answered Nov 22 at 10:40
Darren
517410
517410
add a comment |
add a comment |
You're trying to access the value inside your BbDescriptionDictionay
array using the value and not the index. You have to use the index to access the value of an array.
Just add index
as a second parameter of your forEach
function.
this.boardBasisOptions.forEach( (value, index) => {
boardBasisOptionsModified.push({
"key": value, "value": BbDescriptionDictionary[index]
});
});
add a comment |
You're trying to access the value inside your BbDescriptionDictionay
array using the value and not the index. You have to use the index to access the value of an array.
Just add index
as a second parameter of your forEach
function.
this.boardBasisOptions.forEach( (value, index) => {
boardBasisOptionsModified.push({
"key": value, "value": BbDescriptionDictionary[index]
});
});
add a comment |
You're trying to access the value inside your BbDescriptionDictionay
array using the value and not the index. You have to use the index to access the value of an array.
Just add index
as a second parameter of your forEach
function.
this.boardBasisOptions.forEach( (value, index) => {
boardBasisOptionsModified.push({
"key": value, "value": BbDescriptionDictionary[index]
});
});
You're trying to access the value inside your BbDescriptionDictionay
array using the value and not the index. You have to use the index to access the value of an array.
Just add index
as a second parameter of your forEach
function.
this.boardBasisOptions.forEach( (value, index) => {
boardBasisOptionsModified.push({
"key": value, "value": BbDescriptionDictionary[index]
});
});
answered Nov 22 at 10:41
cyr-x
7,118932
7,118932
add a comment |
add a comment |
By taking the index, you could use Array#map
instead of Array#push
.
const BbDescriptionDictionary = ['AAA', 'BBB', 'CCC',]
this.boardBasisOptions = this
.boardBasisOptions
.map((key, index) => ({ key, value: BbDescriptionDictionary[index] }));
add a comment |
By taking the index, you could use Array#map
instead of Array#push
.
const BbDescriptionDictionary = ['AAA', 'BBB', 'CCC',]
this.boardBasisOptions = this
.boardBasisOptions
.map((key, index) => ({ key, value: BbDescriptionDictionary[index] }));
add a comment |
By taking the index, you could use Array#map
instead of Array#push
.
const BbDescriptionDictionary = ['AAA', 'BBB', 'CCC',]
this.boardBasisOptions = this
.boardBasisOptions
.map((key, index) => ({ key, value: BbDescriptionDictionary[index] }));
By taking the index, you could use Array#map
instead of Array#push
.
const BbDescriptionDictionary = ['AAA', 'BBB', 'CCC',]
this.boardBasisOptions = this
.boardBasisOptions
.map((key, index) => ({ key, value: BbDescriptionDictionary[index] }));
answered Nov 22 at 10:50
Nina Scholz
174k1387151
174k1387151
add a comment |
add a comment |
You should just use Array.prototype.map()
to create a new, mutated array rather than worrying about creating temporary arrays, mutating them and then assigning them.
const BbDescriptionDictionary = ['AAA' , 'BBB', 'CCC',]
// Map runs the function on each array item and returns a new array
// with mutated the return value of that function
// Note: ({ ... }) is a shorthand way of returning a value
// (object in this case) without a function body {}
this.boardBasisOptions = this.boardBasisOptions.map((key, index) => ({
// Shorthand way of assigning a variable to an object using the var
// name as the key
key,
value: BbDescriptionDictionary[index]
})
Its is considered bad practice to override properties like this, so I would return the original boardBasisOptions
to a a new property and use that later on:
const BbDescriptionDictionary = ['AAA' , 'BBB', 'CCC',]
this.boardBasisOptionsWithDescriptions = this.boardBasisOptions.map((key, index) => ({
key,
value: BbDescriptionDictionary[index]
})
Hope that helps 👍
add a comment |
You should just use Array.prototype.map()
to create a new, mutated array rather than worrying about creating temporary arrays, mutating them and then assigning them.
const BbDescriptionDictionary = ['AAA' , 'BBB', 'CCC',]
// Map runs the function on each array item and returns a new array
// with mutated the return value of that function
// Note: ({ ... }) is a shorthand way of returning a value
// (object in this case) without a function body {}
this.boardBasisOptions = this.boardBasisOptions.map((key, index) => ({
// Shorthand way of assigning a variable to an object using the var
// name as the key
key,
value: BbDescriptionDictionary[index]
})
Its is considered bad practice to override properties like this, so I would return the original boardBasisOptions
to a a new property and use that later on:
const BbDescriptionDictionary = ['AAA' , 'BBB', 'CCC',]
this.boardBasisOptionsWithDescriptions = this.boardBasisOptions.map((key, index) => ({
key,
value: BbDescriptionDictionary[index]
})
Hope that helps 👍
add a comment |
You should just use Array.prototype.map()
to create a new, mutated array rather than worrying about creating temporary arrays, mutating them and then assigning them.
const BbDescriptionDictionary = ['AAA' , 'BBB', 'CCC',]
// Map runs the function on each array item and returns a new array
// with mutated the return value of that function
// Note: ({ ... }) is a shorthand way of returning a value
// (object in this case) without a function body {}
this.boardBasisOptions = this.boardBasisOptions.map((key, index) => ({
// Shorthand way of assigning a variable to an object using the var
// name as the key
key,
value: BbDescriptionDictionary[index]
})
Its is considered bad practice to override properties like this, so I would return the original boardBasisOptions
to a a new property and use that later on:
const BbDescriptionDictionary = ['AAA' , 'BBB', 'CCC',]
this.boardBasisOptionsWithDescriptions = this.boardBasisOptions.map((key, index) => ({
key,
value: BbDescriptionDictionary[index]
})
Hope that helps 👍
You should just use Array.prototype.map()
to create a new, mutated array rather than worrying about creating temporary arrays, mutating them and then assigning them.
const BbDescriptionDictionary = ['AAA' , 'BBB', 'CCC',]
// Map runs the function on each array item and returns a new array
// with mutated the return value of that function
// Note: ({ ... }) is a shorthand way of returning a value
// (object in this case) without a function body {}
this.boardBasisOptions = this.boardBasisOptions.map((key, index) => ({
// Shorthand way of assigning a variable to an object using the var
// name as the key
key,
value: BbDescriptionDictionary[index]
})
Its is considered bad practice to override properties like this, so I would return the original boardBasisOptions
to a a new property and use that later on:
const BbDescriptionDictionary = ['AAA' , 'BBB', 'CCC',]
this.boardBasisOptionsWithDescriptions = this.boardBasisOptions.map((key, index) => ({
key,
value: BbDescriptionDictionary[index]
})
Hope that helps 👍
edited Nov 22 at 10:58
answered Nov 22 at 10:53
Stuart Wilson
613
613
add a comment |
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.
Some of your past answers have not been well-received, and you're in danger of being blocked from answering.
Please pay close attention to the following guidance:
- 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%2f53429013%2fmodify-javascript-foreach-result-with-value-from-another-array%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
what is
boardBasisOptions
?– Pardeep Jain
Nov 22 at 10:38
btw, your dictionary is an array, that means you access it with an index, not a value.
– Nina Scholz
Nov 22 at 10:39
value is an item in the array "boardBasisOptions"... while you should provide an indexNumber to "BbDescriptionDictionary[value]"...
– AIqbalRaj
Nov 22 at 10:40
1
You array works with indexes, not named properties. Using
BbDescriptionDictionary[value]
will translate toBbDescriptionDictionary['AAA']
, while it should beBbDescriptionDictionary[0]
.– trichetriche
Nov 22 at 10:40