filmov
tv
freeCodeCamp JS Basic Algorithm Scripting 1-2BGM

Показать описание
function findLongestWordLength(str) {
let maxLength = 0;
if (words[i].length isbiggerthan maxLength) {
maxLength = words[i].length; }
}
return maxLength; }
(Declarative approach)
function confirmEnding(str, target) {
// "Never give up and good luck will find you."
// -- Falcor
}
confirmEnding("He has to give me a new name", "name");
- operator = 倒着数
accumulate积聚
truncate截短的
primitive原始的
function booWho(bool) { return (bool === true || bool === false); }
function booWho(bool) { return (bool === true || bool === false); }
Uses the operator typeof to check if the variable is a boolean
function titleCase(str) {
const updatedTitle = [];
//设置array 基础操作
for (let st in newTitle){
updatedTitle[st] = newTitle
[st][0].toUpperCase() +
newTitle[st].slice(1).
toLowerCase();
//st随便写,它是个参数,没有啥特别意义,只是给你个指示
//看来slice(1)代表从1号字往后都是执行某种命令 从1我靠我的K380键盘按钮掉了 Ykey 弄好了 这个st看来是
}
}
titleCase("I'm a little tea pot");
let maxLength = 0;
if (words[i].length isbiggerthan maxLength) {
maxLength = words[i].length; }
}
return maxLength; }
(Declarative approach)
function confirmEnding(str, target) {
// "Never give up and good luck will find you."
// -- Falcor
}
confirmEnding("He has to give me a new name", "name");
- operator = 倒着数
accumulate积聚
truncate截短的
primitive原始的
function booWho(bool) { return (bool === true || bool === false); }
function booWho(bool) { return (bool === true || bool === false); }
Uses the operator typeof to check if the variable is a boolean
function titleCase(str) {
const updatedTitle = [];
//设置array 基础操作
for (let st in newTitle){
updatedTitle[st] = newTitle
[st][0].toUpperCase() +
newTitle[st].slice(1).
toLowerCase();
//st随便写,它是个参数,没有啥特别意义,只是给你个指示
//看来slice(1)代表从1号字往后都是执行某种命令 从1我靠我的K380键盘按钮掉了 Ykey 弄好了 这个st看来是
}
}
titleCase("I'm a little tea pot");