0
Participant
,
/t5/acrobat-sdk-discussions/js-question-does-list-have-value/td-p/12366196
Sep 06, 2021
Sep 06, 2021
Copy link to clipboard
Copied
Good day honorable adobe forum members,
I am looking for the method to use to check if a value is in a list
i.e.:
var list = ["A","B","C"]
if ("a" in list) {
//dothings
}
Hoe does one do this effectively?
Thank you in advance for any and all trouble to be taken
TOPICS
Acrobat SDK and JavaScript
,
Windows
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting.
Learn more
1 Correct answer
Community Expert
,
Sep 06, 2021
Sep 06, 2021
Yes, using the indexOf method. See: https://www.w3schools.com/jsref/jsref_indexof_array.asp
Wardenburg
AUTHOR
Participant
,
/t5/acrobat-sdk-discussions/js-question-does-list-have-value/m-p/12366197#M87534
Sep 06, 2021
Sep 06, 2021
Copy link to clipboard
Copied
I see I typed "a" instead of "A" , I hope this doesn't cause confusion (the example should say "A")
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting.
Learn more
Community Expert
,
/t5/acrobat-sdk-discussions/js-question-does-list-have-value/m-p/12366213#M87535
Sep 06, 2021
Sep 06, 2021
Copy link to clipboard
Copied
Yes, using the indexOf method. See: https://www.w3schools.com/jsref/jsref_indexof_array.asp
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting.
Learn more
Wardenburg
AUTHOR
Participant
,
/t5/acrobat-sdk-discussions/js-question-does-list-have-value/m-p/12372330#M87570
Sep 09, 2021
Sep 09, 2021
Copy link to clipboard
Copied
Thank you try67, your presence on these boards is a godsend.
Thank you very much once more.
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting.
Learn more
Community Expert
,
LATEST
/t5/acrobat-sdk-discussions/js-question-does-list-have-value/m-p/12372334#M87571
Sep 09, 2021
Sep 09, 2021
Copy link to clipboard
Copied
You're very welcome!
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting.
Learn more

