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

#48-challenge-counting-letters #49

Merged
merged 9 commits into from
Jul 19, 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
3 changes: 3 additions & 0 deletions staff/carlos-bock/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
############This is a comment have a nice day :)
.DS_Store
thumbs.db
24 changes: 24 additions & 0 deletions staff/carlos-bock/challenge-letter/counting-letters.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
// Crea una funcion llamada 'countingLetters' que admita un parámetro de tipo
// string y te devuelva el largo de la palabra. Ej: 'hola' ==> 4.
// NO CHAT GPT

function countingLetters(value) {
var result;
result = value.length;
return result;
}

var result1 = countingLetters("hola");
console.assert(result1 === 4, { result: result1, message: "Test 1 no pasado" });

var result2 = countingLetters("belen");
console.assert(result2 === 5, { result: result2, message: "Test 2 no pasado" });

var result3 = countingLetters("foo");
console.assert(typeof result3 === "number", {
result: result3,
message: "Test 3 no pasado",
});

countingLetters("string1");
countingLetters("this is a longer string");