Learn ECMAScript 6 in Arabic #11 - New String Methods - Includes, Repeat

preview_player
Показать описание
New String Methods - Includes, Repeat

=============================

Support Me on Patreon to Help me Create More Videos

I will be Very Happy if you Support my Channel.

Join Our Facebook Group:

Follow My Facebook Profile:

Like Facebook Page:

Follow Me On Twitter:
Рекомендации по теме
Комментарии
Автор

function repeatStr(strVal, length) {
rStr = "";
for (let i = 0; i < length; i = i + 1) rStr += strVal;
return rStr;
}
console.log(repeatStr("Hello World ", 20));

lava_dev
Автор

let repeat = (str, num) => str.repeat(num)

console.log(repeat("yassin ", 10))

yassindevelper
Автор

مثال بيجمع تقريبا كل الدروس يلي فاتت
let test = (username = "Mazen", age = 32) => (`my name is ${username} and my age is ${age} years`)

console.log(test().repeat(2))



MAZZEN
Автор

حضرتك انا عند الدقيقة 2:15 بالنسبة للوصول لPOSSITION مفيش طريقة بالكود تهلينى ماعدشى اعد يدوى يعنى عايز اوصل لPOSSITION الاول مثل اللPOSSITION لازم اعد بنفسى عشان احدده ؟ ولا فيه METOD يتجيبه ؟

actionscript
Автор

function repeato(counto){
let re = '';
re =counto.repeat(10);
return re;
}
console.log(repeato('this is nice car\n'));

mobrothers
Автор

let myText = 'Elzero Web School';

// includes
// Result is true because they string from index 0 include the word "Web"
console.log(myText.includes("Web", 7)); // Result is false because if we start from index 7 the word "Web" isn't included

// repeats
console.log(myText.repeat()); // The console log won't return anything as we didn't mention how many time the string is going to be mentioned.
// The string isn'g going to be repeated it will be only 1 string.
// The string 'Elzero Web School' is going to be repeated another time.
// The string 'Elzero Web School' is going to be repeated twice.

// Repeat using function
let repeatStr = (counter) => {

}
repeatStr(4);

// Advanced repeat string by function
let advRepeatStr = (yourStr, counter) => {

}
advRepeatStr('Hello there', 2);

itgiants
Автор

function repeat()
{
let s = "ahmed ashraf abd elsalam", B='' ";
for(let i=0;i<3;i++)
B+=s;
return B;
}

console.log(repeat());

ahmedashraf