In JavaScript, the equivalent of the PHP function in_array() is the includes() method, which is used to check if an array contains a certain value.
Source code viewer
['a', 'b', 'c', 'd'].includes('c'); // Console output: trueProgramming Language: Javascript