From: https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Object
Object.keys()
Returns an array containing the names of all of the given object's own enumerable string properties.
This says that 'includes' works on strings: https://www.w3schools.com/jsref/jsref_includes.asp
Then why is the following statement valid in the code shown in this SO thread?
https://stackoverflow.com/a/66758849/462608
const colorValues = Object.keys(this.colorValues);
const invalidColors = colors.filter(c => !colorValues.includes(c));
includesworks on arrays too: developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/…w3schoolsfor information. The MDN developer guides are a much better resource.includes: w3schools.com/jsref/jsref_includes_array.asp