some(), includes()

In this example below you will see how to do a some(), includes() with some HTML / CSS and Javascript

This awesome code was written by elaboratecon, you can see more from this user in the personal repository.
You can find the original code on
Copyright elaboratecon ©
  • HTML
  • CSS
  • JavaScript
    Open the console...

/*Downloaded from */

/*Downloaded from */
    const cats = [ 'sam', 'max', 'ed' ]

cats.some((cat) => cat === 'sam') ? console.log('Some: Cat present') : console.log('Some: Cat not present')

cats.includes('sam') ? console.log('Includes: Cat present') : console.log('Includes: Cat not present')