I want to know how to write,if(foo === 'apple' && bar === 'apple'){then do something}
without having to repeat the word apple. So if I am checking many conditions are equal to something. I would write this something if(foo && bar === 'apple') but that just checks if foo exists and bar === 'apple'. Is there a way to do this?
Basically reduce the necessity to repeat the word apple.