freeCodeCamp JS Basic Algorithm Scripting 1-2BGM

Subscribers:
17
Published on ● Video Link: https://www.youtube.com/watch?v=5Pksf0o3ByM



Duration: 1:03:41
0 views
0


function findLongestWordLength(str) {
let words = str.split(' ');
let maxLength = 0;
for (let i = 0; i islowerthan words.length; i++) {
if (words[i].length isbiggerthan maxLength) {
maxLength = words[i].length; }
}
return maxLength; }

https://forum.freecodecamp.org/t/freecodecamp-challenge-guide-find-the-longest-word-in-a-string/16015


(Declarative approach)
function confirmEnding(str, target) {
// "Never give up and good luck will find you."
// -- Falcor

return str.slice(str.length - target.length) === target;
}

confirmEnding("He has to give me a new name", "name");

https://forum.freecodecamp.org/t/freecodecamp-challenge-guide-confirm-the-ending/16006

- 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 newTitle = str.split(" ");//哇,看来这里要分离,把space变为comma

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看来是


}

return updatedTitle.join(" ");//看来这个join能把东西加在一起

}


titleCase("I'm a little tea pot");




Other Videos By 月亮上的袁


2022-09-11♥我的世界♥恐怖联机故事完结Dyemona2 Labin Story
2022-09-11♥我的世界♥恐怖联机The Territory中毒梦见疯狂科学家(2)未完待续
2022-09-11♥我的世界♥恐怖联机The Territory我们被异形神父出卖了(1)
2022-09-11♥我的世界♥恐怖联机Contagion传染病半条命2风格ft HalfLife2
2022-09-11♥我的世界♥恐怖鬼打墙WAIT
2022-09-11♥我的世界♥恐怖短图斧子先生Sir Axe
2022-09-10freeCodeCamp JS Basic Algorithm Scripting 12-16[前边几关的视频好像被我不小心删掉了,没事以后重刷这块]
2022-09-08♥我的世界♥恐怖冒险新危险NEW DANGER【失败/放弃录像】【双人联机】
2022-09-08♥我的世界♥恐怖冒险后室求生SURVIVE THE BACKROOMS【双人联机】
2022-09-05freeCodeCamp JS Basic Algorithm Scripting 4-5MinecraftBGM+前几分钟语音解说
2022-09-05freeCodeCamp JS Basic Algorithm Scripting 1-2BGM
2022-09-05♥皇室战争♥赛季末最骚卡组刷皇冠(上)9月3日
2022-09-05♥皇室战争♥赛季末最骚卡组刷皇冠(中)9月4日
2022-09-05♥皇室战争♥赛季末最骚卡组刷皇冠(下)9月4日
2022-09-05freeCodeCamp JS Basic Algorithm Scripting 6-7
2022-09-05freeCodeCamp JS Basic Algorithm Scripting 3
2022-09-05♥我的世界♥生存冒险CTM贝尔德罗斯审判The Trials of Beldroth城堡外围与列车洞(6)
2022-09-05♥我的世界♥生存冒险CTM贝尔德罗斯审判The Trials of Beldroth地牢与贝尔德罗斯短剑(5)
2022-09-05♥我的世界♥生存冒险CTM贝尔德罗斯审判The Trials of Beldroth蘑菇洞营地与诡异洞窟(4)
2022-09-05♥我的世界♥生存冒险CTM贝尔德罗斯审判The Trials of Beldroth蘑菇洞探险然后再回来打牛(3)
2022-09-04♥我的世界♥恐怖冒险破布洞KROT HOLE【双人联机】