Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

1st task #1

Merged
merged 5 commits into from
Oct 23, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion 0-module/1-task/index.js
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
function sum(m, n) {
// ваш код...
return m + n; // ваш код...
}
7 changes: 6 additions & 1 deletion 1-module/1-task/index.js
Original file line number Diff line number Diff line change
@@ -1,3 +1,8 @@
function factorial(n) {
// ваш код...

let fact = 1;
for (let i = 1; i <= n; i++) {
fact = fact * i;
}
return fact; // мой код...
}
7 changes: 6 additions & 1 deletion 1-module/2-task/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,12 @@ function print(text) {
* чтобы функция sayHello работала корректно
*/
function isValid(name) {
// ваш код...
if (name === null || name.includes(" ") || name.length < 4 ) {
return false;
}
else {
return true;
} // мой код...
}

function sayHello() {
Expand Down
2 changes: 1 addition & 1 deletion 1-module/3-task/index.js
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
function ucFirst(str) {
// ваш код...
return (str.slice(0, 1).toUpperCase () + str.slice(1)); // мой код...
}
8 changes: 5 additions & 3 deletions 1-module/4-task/index.js
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
function checkSpam(str) {
// ваш код...
}
function checkSpam(str) { // мой код...
let strtoLowerCase = str.toLowerCase();
return strtoLowerCase.includes('1xbet') || strtoLowerCase.includes('xxx');

}
2 changes: 1 addition & 1 deletion 1-module/5-task/index.js
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
function truncate(str, maxlength) {
// ваш код...
return str.length > maxlength ? str.slice(0, maxlength - 1) + "…" : str; // мой код...
}