Created
June 16, 2022 12:05
-
-
Save evgeniyworkbel/c9c9ffb97ab122e0dd1644bcf8d44ae6 to your computer and use it in GitHub Desktop.
Курс "JS: Объекты" Hexlet.io
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
scrabble.js | |
Реализуйте и экспортируйте по умолчанию функцию-предикат, которая принимает на вход два параметра: набор символов в нижнем регистре (строку) и слово, и проверяет, можно ли из переданного набора составить это слово. В результате вызова функция возвращает true или false. | |
При проверке учитывается количество символов, нужных для составления слова, и не учитывается их регистр. | |
Примеры | |
scrabble('rkqodlw', 'world'); // true | |
scrabble('avj', 'java'); // false | |
scrabble('avjafff', 'java'); // true | |
scrabble('', 'hexlet'); // false | |
scrabble('scriptingjava', 'JavaScript'); // true |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment