some(), includes()

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

Thumbnail
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 Codepen.io
Copyright elaboratecon ©
  • HTML
  • CSS
  • JavaScript
    Open the console...

/*Downloaded from https://www.codeseek.co/elaboratecon/some-includes-RyGNBm */
    


/*Downloaded from https://www.codeseek.co/elaboratecon/some-includes-RyGNBm */
    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')



Comments