Skip to content

Commit

Permalink
Create Is it a rainbow?.js
Browse files Browse the repository at this point in the history
  • Loading branch information
Automedon authored Aug 2, 2019
1 parent 62ed73c commit eba7d6c
Showing 1 changed file with 12 additions and 0 deletions.
12 changes: 12 additions & 0 deletions Is it a rainbow?.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
/*
It is a sunny day and then a cloud appears from no where.... Now there are hundreds of rainbows everywhere.
You must check they are full and beautiful.
You will be given an array that represents the rainbow and you need to check if it is a full rainbow, or not and return true or false.
E.g. colours['1','2'] will return false
*/
function sortRainbow(colour){
return ['red','orange','yellow','green','blue','indigo','violet'].every((v,i)=>v===colour[i])
}

0 comments on commit eba7d6c

Please sign in to comment.