--- title: I before E except after C id: 5a23c84252665b21eecc7eb0 challengeType: 5 --- ## Description
The phrase "I before E, except after C" is a widely known mnemonic which is supposed to help when spelling English words. Using the words provided, check if the two sub-clauses of the phrase are plausible individually:
  1. "I before E when not preceded by C".
  2. "E before I when preceded by C".
If both sub-phrases are plausible then the original phrase can be said to be plausible. Write a function that accepts a word and check if the word follows this rule. The function should return true if it follows the rule otherwise false.
## Instructions
## Tests
```yml tests: - text: '''IBeforeExceptC should be a function.''' testString: 'assert(typeof IBeforeExceptC==''function'',''IBeforeExceptC should be a function.'');' - text: '''IBeforeExceptC("receive") should return a boolean.''' testString: 'assert(typeof IBeforeExceptC("receive")==''boolean'',''IBeforeExceptC("receive") should return a boolean.'');' - text: '''IBeforeExceptC("receive") should return true.''' testString: 'assert.equal(IBeforeExceptC("receive"),true,''IBeforeExceptC("receive") should return true.'');' - text: '''IBeforeExceptC("science") should return false.''' testString: 'assert.equal(IBeforeExceptC("science"),false,''IBeforeExceptC("science") should return false.'');' - text: '''IBeforeExceptC("imperceivable") should return true.''' testString: 'assert.equal(IBeforeExceptC("imperceivable"),true,''IBeforeExceptC("imperceivable") should return true.'');' - text: '''IBeforeExceptC("inconceivable") should return true.''' testString: 'assert.equal(IBeforeExceptC("inconceivable"),true,''IBeforeExceptC("inconceivable") should return true.'');' - text: '''IBeforeExceptC("insufficient") should return false.''' testString: 'assert.equal(IBeforeExceptC("insufficient"),false,''IBeforeExceptC("insufficient") should return false.'');' - text: '''IBeforeExceptC("omniscient") should return false.''' testString: 'assert.equal(IBeforeExceptC("omniscient"),false,''IBeforeExceptC("omniscient") should return false.'');' ```
## Challenge Seed
```js function IBeforeExceptC (word) { // Good luck! } ```
## Solution
```js function IBeforeExceptC (word) { if(word.indexOf("c")==-1 && word.indexOf("ie")!=-1) return true; else if(word.indexOf("cei")!=-1) return true; return false; } ```