diff --git a/exercises/practice/grains/.approaches/bit-shifting/content.md b/exercises/practice/grains/.approaches/bit-shifting/content.md index 27801dcd7b..0711a5bae9 100644 --- a/exercises/practice/grains/.approaches/bit-shifting/content.md +++ b/exercises/practice/grains/.approaches/bit-shifting/content.md @@ -3,7 +3,7 @@ ```javascript export function square(num) { if (num < 1 || num > 64) { - throw 'square must be between 1 and 64'; + throw new Error('square must be between 1 and 64'); } return 1n << (BigInt(num) - 1n); } diff --git a/exercises/practice/grains/.approaches/bit-shifting/snippet.txt b/exercises/practice/grains/.approaches/bit-shifting/snippet.txt index 83e4a13ccf..0c29f9a2d1 100644 --- a/exercises/practice/grains/.approaches/bit-shifting/snippet.txt +++ b/exercises/practice/grains/.approaches/bit-shifting/snippet.txt @@ -1,6 +1,6 @@ export function square(num) { if (num < 1 || num > 64) { - throw "square must be between 1 and 64"; + throw new Error('square must be between 1 and 64'); } return 1n << (BigInt(num) - 1n); } diff --git a/exercises/practice/grains/.approaches/introduction.md b/exercises/practice/grains/.approaches/introduction.md index 84312036af..e9ce5b2e74 100644 --- a/exercises/practice/grains/.approaches/introduction.md +++ b/exercises/practice/grains/.approaches/introduction.md @@ -44,7 +44,7 @@ For more information, check the [exponentiation approach][approach-exponentiatio ```javascript export function square(num) { if (num < 1 || num > 64) { - throw 'square must be between 1 and 64'; + throw new Error('square must be between 1 and 64'); } return 1n << (BigInt(num) - 1n); }