Is it possible to design a function that has an array like the below and use an if statement to check if the type is equal to the following in any of my categories in my array below and return its associate category code?
Example:
function CheckCategory(type) {
array =
[NOTES, CAT-A],
[BOOKS, CAT-B],
[MUSIC, CAT-C],
[SOFTWARE, CAT-D]
if (type == "NOTES") { return "CAT-A" }
}