0

I am trying to check when my array contains certain values:

if( array == ["value1", "value2", "value3"] ){
    console.log('yes');
}else{
    console.log('no');
}

But it does not work...


Update: Thanks for help, now this is working for me:

if( JSON.stringify(array) == JSON.stringify(["value1", "value2", "value3"]) ){
    console.log('yes');
}else{
    console.log('no');
}
neoDev
  • 2,879
  • 3
  • 33
  • 66
  • I've been studying functional programming and saw your question. I was curious to answer it using some techniques that are new to me. I've shared my answer [here](http://stackoverflow.com/a/34256998/633183). – Mulan Dec 13 '15 at 22:14
  • @naomik thanks mate! – neoDev Dec 14 '15 at 16:09

0 Answers0