100 Days of JavaScript Coding Challenges || Day #2

Поделиться
HTML-код
  • Опубликовано: 27 ноя 2024

Комментарии • 90

  • @ThapaTechnical
    @ThapaTechnical  8 месяцев назад +11

    Guy's hope you love the video❤ Plz LIKE SHARE & SUBSCRIBE NOW 😊

    • @MajidSadiq-e9y
      @MajidSadiq-e9y 8 месяцев назад

      Javascript part 2 ky source code me Events wala folder missing hai Sir please upload it

    • @payalverma4653
      @payalverma4653 8 месяцев назад

      We are loving it Sir.. keep going......!!!! 😊

  • @goswamiparasgiri4438
    @goswamiparasgiri4438 8 месяцев назад +10

    My Solution
    function generateHash(str){
    if(str.length >= 280 || str.trim().length === 0){
    return false
    }
    const strUpperCase = str.split(" ").map(curr => curr.charAt(0).toUpperCase() + curr.slice(1)).join("")
    const hashStr = `#${strUpperCase}`
    return hashStr
    }

  • @AmiteshSir-y3d
    @AmiteshSir-y3d 8 месяцев назад +2

    Thapa technical is the world best platform for coding learning

  • @ShivSharma786
    @ShivSharma786 8 месяцев назад +5

    Ye Interview Questions series laake aapne bohot acha kiya.Naye Javascript sikhne waalo ka concept bohot clear ho jaayega.

  • @ajitchirkhe4977
    @ajitchirkhe4977 8 месяцев назад +1

    HTML CSS and JavaScript such mai world 🌍 best course ❤

  • @zubinnair8233
    @zubinnair8233 8 месяцев назад +4

    we can do it in this following way using reduce -- >
    function generateHash(str){
    if(!str.trim().length || str.length>=280){
    return false;
    }
    const res = str.trim().split(" ").reduce((acc,elem)=>{
    return acc+elem.replace(elem.charAt(0),elem.charAt(0).toUpperCase());
    },"#");
    return res;
    }
    console.log(generateHash("try programiz"));

    • @Supreme.Speech29
      @Supreme.Speech29 Месяц назад

      sister,how much time you give in the javascript???

  • @QuantumXdeveloper
    @QuantumXdeveloper 8 месяцев назад +1

    Thanks Bhaiya, #2NdDayOfJavaScriptChallenge

  • @owaisnadeem2751
    @owaisnadeem2751 8 месяцев назад +1

    Day 02 Present Sir . Love and Respect from Pakistan

  • @pavithrakumar8748
    @pavithrakumar8748 6 месяцев назад +2

    const HashTagGenerator = (str) =>{
    if(str.trim().length===0 || str.length>280){
    return false;
    }
    const words = str.split(" ");
    console.log(words);
    let hashString="#";
    for(let word of words){
    hashString+=word.charAt(0).toUpperCase()+word.slice(1);
    }
    return hashString;
    }

  • @Anilkumar-j3p7u
    @Anilkumar-j3p7u 8 месяцев назад

    world best Html,Css , Javascript course 🎉❤

  • @bhaviksuiya6600
    @bhaviksuiya6600 8 месяцев назад +2

    Hey I done this in Java Code by myself without watching Full Video And i successfully done it i am going to follow this whole series Thanks (◔◡◔)
    Also One suggestion I want like you give us Next challenge in this video i mean we try Day-3 by self so just give problem of next day at each previous day

  • @sportsmentor6655
    @sportsmentor6655 8 месяцев назад

    Sir i am watching your world best JavaScript course it is amazing i learned a lot ❤❤❤

  • @sarthak5885Vyas
    @sarthak5885Vyas 2 месяца назад +1

    my solution :
    const Hashgenerator = (str) => {
    if(str.length > 280 || str.trim().length {
    return el = el.charAt(0).toUpperCase() + el.slice(1)
    })
    return str = "#"+str.join("")

    }
    const res = Hashgenerator("my name is sarthak vyas")
    console.log(res)

  • @SameerAkram-qx8bt
    @SameerAkram-qx8bt 8 месяцев назад +1

    great videos sir

  • @MuhammadUsman-ok5vs
    @MuhammadUsman-ok5vs 7 месяцев назад +1

    Awesome

  • @Harmanpreetsingh-q1m
    @Harmanpreetsingh-q1m 8 месяцев назад

    i do it with forEach loop
    Great video😍😍😍😍😍😍😍

  • @indian_designer
    @indian_designer 8 месяцев назад

    In the second solution, we can also use the rest operator for getting the remaining letters.

  • @kapilraivines8486
    @kapilraivines8486 8 месяцев назад +1

    I don't know much javascript but I have good command on Java so I am solve these questions in java language 😅

  • @CSTPortal
    @CSTPortal 8 месяцев назад

    Starting from Today.. Day 1

  • @ZenRahul24
    @ZenRahul24 8 месяцев назад

    Day02 completed sucessfully🍀🍀

  • @irfantalib4650
    @irfantalib4650 8 месяцев назад

    Thanks Bro..

  • @ajitchirkhe4977
    @ajitchirkhe4977 8 месяцев назад

    1ch number thapa bhai❤

  • @Asim_Ali4857
    @Asim_Ali4857 8 месяцев назад

    We are here in #Day-2

  • @BhagatBhutale..
    @BhagatBhutale.. 8 месяцев назад

    JavaScript Challenge 100/2 day is Completed 👍

  • @AdityaGrover-ly9jf
    @AdityaGrover-ly9jf 8 месяцев назад

    ❤❤😊 thanks sir

  • @pintukumar-bs5ew
    @pintukumar-bs5ew 8 месяцев назад

    instead of slice we can use substring

  • @Tarun-zv5zf
    @Tarun-zv5zf 7 месяцев назад

    const hashgenerator = (str)=>{
    if(!str){return false}
    if(str.length = 280){return false}
    let arr = str.trim().split(" ")
    arr = arr.map(item=>{
    return item.slice(0,1).toUpperCase().concat(item.slice(1))
    })
    arr.unshift("#")
    return arr.join("")
    }

  • @Sipra_Developer
    @Sipra_Developer 8 месяцев назад

    This Is what I want 10000000%

  • @MakrandGuravM
    @MakrandGuravM 3 месяца назад

    Just in case someone is looking for an example using reduce:
    const generateHashTag = (sentence) => {
    let sentenceArr = sentence.split(" ");
    const hashTag = sentenceArr.reduce((acc, currElem) => {
    acc += currElem
    .slice(0, 1)
    .toUpperCase()
    .concat(currElem.slice(1, currElem.length));
    return acc;
    }, "#");

  • @souravsarkar-mu8hq
    @souravsarkar-mu8hq 8 месяцев назад

    Love you ❤

  • @vickygupta7578
    @vickygupta7578 3 месяца назад

    MySolution
    const generateHash = (str) => {
    if (str.length > 280 || str.trim().length === 0) {
    return false;
    }
    let resultString = "";
    let words = str.split(" ");
    words.forEach((element) => {
    resultString += element[0].toUpperCase() + element.slice(1);
    });
    return "#" + resultString;
    };

  • @smallstepz
    @smallstepz 2 месяца назад

    function genearetHashTag(string){
    if(string.trim().length >= 280){
    return false;
    }
    let arrayOfString = string.split(" ");
    let prefix = "#";
    for(let str of arrayOfString){
    prefix+= (str.at(0).toUpperCase()+str.substr(1, str.length));
    }
    return prefix;
    }
    console.log(genearetHashTag("my name is anusuya bhattacharjee"))

  • @theboss195
    @theboss195 6 месяцев назад

    //? Question:
    //? You are required to implement a function generateHash that generates a hash tag from a given input string. The hash tag should be constructed as follows:
    //? The input string should be converted to a hash tag format, where each word is capitalized and concatenated together without spaces.
    //? If the length of the input string is greater than 250 characters or if the input string is empty or contains only whitespace, the function should return false.
    //? Otherwise, the function should return the generated hash tag prefixed with #.
    //* Solution:
    function generateHash(str) {
    if (str.length > 250 && !str.trim()) return false;
    const words = str.split(" ");
    const capitalizedWords = words.map(
    (word) => word[0].toUpperCase() + word.slice(1)
    );
    return `#${capitalizedWords.join("")}`;
    }
    console.log(generateHash("diwash bhattarai"));

  • @vaibhav5499
    @vaibhav5499 8 месяцев назад

    Sir please start the world best react native course

  • @aditya-d-
    @aditya-d- 8 месяцев назад +2

    sir me 360p par dekha ta hu apka code isar acha nahi dikhata, can you plz change THEME , use font large

  • @imranmuhammad6668
    @imranmuhammad6668 8 месяцев назад

    Hey, ThapaTechnical Sir, Please html5 canvas pay bhi koi video lay kar aoo.

  • @coding24335
    @coding24335 7 месяцев назад

    🎉🎉🎉

  • @yadurajsinghpamar-sz9kk
    @yadurajsinghpamar-sz9kk 8 месяцев назад

    Make video on php full course 2024
    . Php is also important. 🙏

  • @riyamadaan9343
    @riyamadaan9343 8 месяцев назад

    👍👍

  • @binodkumar-em7ub
    @binodkumar-em7ub 8 месяцев назад

    function generateHash(str) {
    if (str.length

  • @cricketblitz6021
    @cricketblitz6021 8 месяцев назад

    increase the questions. 2 or 3 questions daily

  • @gauravprakash2192
    @gauravprakash2192 8 месяцев назад

    #2

  • @Faizan_Iqbal07
    @Faizan_Iqbal07 8 месяцев назад

    ❤❤❤

  • @talewhisperer1-m7j
    @talewhisperer1-m7j 7 месяцев назад

    function generateHash(str) {
    if (str.trim("") === "" || str.length > 280) {
    return false;
    }

    const words = str.split(" ");
    let hashTagWord = "#";
    for(let word of words){
    word = word[0].toUpperCase() + word.slice(1,word.length);
    hashTagWord+=word;
    }
    return hashTagWord;
    }
    let result = generateHash("Hello this is manoj");
    console.log(result);

  • @BHANUPRATAP-tm6jj
    @BHANUPRATAP-tm6jj 8 месяцев назад

    if it is possible so ,....please solve 3-4 question in single video

  • @priyakarn5191
    @priyakarn5191 8 месяцев назад

    substring ka use krke :i-
    const hashconvert = (name)=>{
    if(name.length>280 || name.trim() === ""){
    return false;
    }
    else{
    const arr = name.split(" ");
    const fres = arr.map((e)=>{
    return e[0].toUpperCase() + e.substring(1);
    })

    return `#${fres.join("")}`

    }
    }
    console.log(hashconvert("my name"))

  • @AnujGupta-10
    @AnujGupta-10 6 месяцев назад

    Thapa bhai, mujhe js ka theoretical knowledge poora hai . Per mere logic + projects nahi banre hai. Like kaise kya likhu samajh nahi aata. Iska kuch upaaye hai to zarur bata dete to kaafi acha rheta. Bohot struggle Karra hu logic banane me🙏

  • @debjitkundu62
    @debjitkundu62 8 месяцев назад

    Sir, What's the font style of your VS code ?

  • @Yu-music-b9j
    @Yu-music-b9j 8 месяцев назад

    why dont you use Capitalize method

  • @RishiRajxtrim
    @RishiRajxtrim 8 месяцев назад

    🙂👍

  • @chandrashekharrawat9202
    @chandrashekharrawat9202 8 месяцев назад

    Solved with for loop
    const str="i am software developer";
    function temp(userStr){
    const splittedStr=userStr.split(" ");
    let convertedStr='';
    for(let i=0;i

  • @AliNurbhanej
    @AliNurbhanej 8 месяцев назад

    JavaScript Files Adhuri Send Huwi Hai Plz Complete Send Kijiye

  • @siya0409
    @siya0409 8 месяцев назад

    Day #2 attendee 👩‍💻

  • @hollywoodmovie2020
    @hollywoodmovie2020 8 месяцев назад

    Thapa sir firsr comment like my comment

  • @ravishbisht502
    @ravishbisht502 8 месяцев назад

    Meno to dono q krr dia khud se

  • @malaikawaqas
    @malaikawaqas 8 месяцев назад

    SIR PLZ BOOTSTRAP P VIDEO BANAEN

  • @savitamourya5285
    @savitamourya5285 5 месяцев назад

    This is the another way ,
    const generateHash = (str) =>{
    if(str.length>28 || str.trim().length ===0){
    return false;
    }
    let stArr = str.split(" ");
    let modifiedArr = stArr.map((curElem)=>{
    return curElem.charAt(0).toUpperCase() + curElem.slice(1);
    })
    let newStr = modifiedArr.join('').replace(/,/g, '').replace('','#');
    return newStr;
    }
    generateHash('i am Piyush mourya');

  • @tamalchakraborty6355
    @tamalchakraborty6355 6 месяцев назад

    #MySolution :
    const generateHash = (str) => {
    if (str.trim().length > 280 || str.trim().length === 0) {
    return false;
    }
    //? making the array out of it
    let arrOfStr = str.split(' ');
    //? adding the hash tag
    let hashTag = '#'
    for (let index = 0; index < arrOfStr.length; index++) {
    hashTag = hashTag + arrOfStr[index][0].toUpperCase() + arrOfStr[index].substring(1);
    }
    return hashTag;
    }

  • @vinayakkittad2083
    @vinayakkittad2083 7 месяцев назад

    I used the reduce method and also employed a new logic, such as substring, and concatenated within the loop using the + operator.
    𝐉𝐚𝐯𝐚𝐒𝐜𝐫𝐢𝐩𝐭 𝐂𝐡𝐚𝐥𝐥𝐞𝐧𝐠𝐞: 2/100 𝐂𝐨𝐦𝐩𝐥𝐞𝐭𝐞𝐝
    Here is the Code:
    /*
    *STATEMENT:
    Problem: Hash Tag Generators
    *Example:
    1]
    input: "my name is Vinayak"
    o/p: #myNameIsVinayak
    2]
    input:""
    o/p: false
    constraints:
    the length should not exceed 280Characters
    should not contain ONLY white spaces/ EMPTY
    if they contains both the above then return false
    */
    function generateHashTags(str) {
    // remove the whitespaces
    if (str.trim().length === 0 || str.trim() > 280) {
    return false;
    }
    const strArray = str.trim().split(" ");
    // ******* Method-1 ********************
    // const result = strArray.reduce(
    // (accm, currWord) =>
    // (accm += currWord[0].toUpperCase() + currWord.substring(1)), //1 method,
    // // (accm += currWord.replace(currWord[0], currWord[0].toUpperCase())),
    // ""
    // );
    // return `#${result}`;
    //*************************** */
    // ******* Method-2********************
    const result = strArray.map(
    (curWord) =>
    // curWord.replace(curWord[0], curWord[0].toUpperCase())
    // curWord.charAt(0).toUpperCase() + curWord.slice(1)
    curWord[0].toUpperCase() + curWord.substring(1)
    );
    console.log(result);
    return `#${result.join("")}`;
    // ***************************
    }
    console.log(generateHashTags("I am vinayak kittad"));

  • @abusufyan4911
    @abusufyan4911 3 месяца назад

    function hashtagGen(sentence){
    if(sentence.length>280 || sentence.trim().length===0){
    return false
    }
    let words = sentence.replace(/\t/g, "").trim().split(" ")

    // first method:
    // let CapitaliseWords = words.map((word)=>{
    // return word.charAt(0).toUpperCase()+word.slice(1)
    // })
    // let hashtagSentence = `#${CapitaliseWords.join("")}`
    // return hashtagSentence
    // 2nd method:
    let CapitaliseWords = words.map(word=>word.replace(word[0],word[0].toUpperCase()))
    return `#${CapitaliseWords.join("")}`
    }
    const res = hashtagGen("Don’t try to be over-smart with me")
    console.log(res)

  • @Quran15246
    @Quran15246 6 месяцев назад

    function Tags(str) {
    if (str.length > 280 || str.trim().length === 0) {
    return false;
    }
    let intoArray = str.split(" ");
    let getFirstLetter = intoArray
    .map((word) => word.toUpperCase().slice(0, 1) + word.slice(1))
    .join("");
    str = `#${getFirstLetter}`;
    console.log(str);
    }
    Tags("hello world");
    Tags("my name is khan");

  • @brijeshshukla5284
    @brijeshshukla5284 7 месяцев назад

    function generateHash(str) {
    if (str.trim().length === 0 || str.length > 180) {
    return false;
    }
    const words = str.split(" ");
    const capitalizedWords = words.map(word => word.charAt(0).toUpperCase() + word.slice(1));
    let joinWords = capitalizedWords.join("");
    let startWithHash = "#" + joinWords;
    return startWithHash;
    }
    console.log(generateHash("my name is thapa technical"));

  • @vishuphysics8564
    @vishuphysics8564 7 месяцев назад +2

    function capitalizeWords(sentence) {
    return sentence.replace(/\b\w/g, char => char.toUpperCase());
    }
    let sentence = "my name is vishal kushwaha";
    let capitalizedSentence = capitalizeWords(sentence);
    let withoutwhitespace="#"+ capitalizedSentence.split(" ").join("");
    console.log(withoutwhitespace);

  • @dikshagupta5879
    @dikshagupta5879 8 месяцев назад

    function hasTag(str) {
    let text = '';
    let temp = [];
    let strarr = str.split(" ");
    if (str.trim().length > 280 || str.trim().length === 0) {
    return false
    } else {
    for (let i = 0; i < strarr.length; i++) {
    temp = strarr[i].split("");
    temp[0] = temp[0].toUpperCase();
    temp = temp.join("");
    text += temp;
    temp = [];
    }
    }
    return (`#${text}`);
    }
    console.log(hasTag("this is a javascript"));

  • @Doraemon-Fun-Time9530
    @Doraemon-Fun-Time9530 7 месяцев назад

    function generateHash(str) {
    if (str.length > 200 || str.trim().length === 0 || str === " ") return false;
    let words = str.split(" ");
    let updatedWord = [];
    for (word of words) {
    word = word[0].toUpperCase() + word.slice(1);
    updatedWord.push(word);
    }
    return `#${updatedWord.join("")}`;
    }

  • @vikrambais5330
    @vikrambais5330 7 месяцев назад

    function hashtag(string){
    //if string length > 280 or itsa an empty or just space
    if(string.length > 280 || string.trim() === '' || string.length === 0){
    return false;
    } else {
    /*removing trainl and end whitespace and making an array*/
    let strArr = string.trim(' ').split(" ");
    /*Now iterating over each array and changing the first character to uppercase*/
    let capitalArray = strArr.map((word)=>{
    return word.charAt(0).toUpperCase() + word.slice(1);
    });
    let hashtag = `#${capitalArray.join('')}`
    return hashtag
    }
    }
    let value = hashtag(" hi this is vikram bais ");
    console.log(value);

  • @rizwanahmadkhan8098
    @rizwanahmadkhan8098 4 месяца назад

    function hashGenerate(str){
    if(str.length >= 280 || str.trim().length === 0){
    return false
    }

    let newStr = str.split(" ")
    let hashWord = ''
    for(let i =0; i

  • @dilipraj8630
    @dilipraj8630 6 месяцев назад

    const genratedHash = (hash)=>{
    if(hash.length === 280 || hash.trim().length === 0){
    return false;
    }
    let hashTag = hash.split(" ");
    let str = "#";
    for(let i = 0; i < hashTag.length; i++){
    let one = hashTag[i];
    let two = one[0].charAt(0).toUpperCase() + one.slice(1);
    str += two;
    }
    return str;
    }
    console.log(genratedHash("my name is dilip"));

  • @vandanraval_5018
    @vandanraval_5018 8 месяцев назад +1

    let generatehashValue = (str) => {
    if (str.length > 250 || str.trim().length === 0) {
    return false;
    }
    str = str.split(" ");
    let eachWords = str.map((el) => {
    return el.replace(el[0], el[0].toUpperCase());
    });
    const finalAns = [...eachWords];
    finalAns.unshift("#");
    console.log("Final String:", finalAns.join(""));
    };
    generatehashValue("csk forever");

  • @samyaksankhesara5668
    @samyaksankhesara5668 8 месяцев назад

    let generateHash = (str) => {
    if (str.length > 280 || str.trim().length === 0) {
    return false;
    }
    let x = str.split(" ")
    console.log(x)
    let y = x.map((e) => {
    return e[0].toLocaleUpperCase() + e.slice(1)
    })
    console.log(y)
    let z = y.join("")
    console.log(z)
    let result = `#${z}`
    console.log(result)
    return result
    }
    console.log(
    generateHash("hello samyak")
    )

    • @Supreme.Speech29
      @Supreme.Speech29 Месяц назад

      sister how much time you give in the javascript for a this stage??

  • @abdurrazzaque5551
    @abdurrazzaque5551 7 месяцев назад

    const generateHash=(str)=>{
    if(str.length > 200 || str.trim().length === 0){
    return false
    }
    else{
    }
    var cheack = str.split(' ')
    var result = []
    for(i=0; cheack.length>i;i++){
    var firstLetter = cheack[i][0].toUpperCase()
    var restOfWrode = cheack[i].slice(1)

    result.push (firstLetter+restOfWrode)
    }
    console.log(`#${result.join('')}`)
    }
    console.log(generateHash("Hello and welcome my name is Abdur Razzaque"));

  • @tayyabafzal7296
    @tayyabafzal7296 6 месяцев назад

    const generateHash = (str) => {
    if (str.length > 280 || str === '') return false;
    const words = str.split(' ');
    let newStr = '';
    //* 1st
    for (const word of words) newStr += word.charAt(0).toUpperCase() + word.slice(1);
    //* 2nd
    newStr = words.map(word => word.replace(word[0], word[0].toUpperCase())).join('');
    return newStr ? '#' + newStr : false;
    };
    const word = generateHash('The quick brown fox jumped over the lazy dog');
    console.log("🚀 ~ word:", word);

  • @bhaviksuiya6600
    @bhaviksuiya6600 8 месяцев назад +1

    Hey I done this in Java Code by myself without watching Full Video And i successfully done it i am going to follow this whole series Thanks (◔◡◔)
    Also One suggestion I want like you give us Next challenge in this video i mean we try Day-3 by self so just give problem of next day at each previous day

  • @najibullahnaziry2018
    @najibullahnaziry2018 8 месяцев назад

    ❤❤