Abdur Rahman
Abdur Rahman
KPCKevin Powell - Community
Created by Abdur Rahman on 6/27/2024 in #front-end
I can't write javascript or do programming all together
Certainly
143 replies
KPCKevin Powell - Community
Created by Abdur Rahman on 6/27/2024 in #front-end
I can't write javascript or do programming all together
Got it, I will keep that in mind
143 replies
KPCKevin Powell - Community
Created by Abdur Rahman on 6/27/2024 in #front-end
I can't write javascript or do programming all together
@ἔρως Thanks for the tip, I really appreciate your help. I have a quick question if you don't mind. When you plan out the steps/logic before writing the code, what do you do if you feel stuck and can't pinpoint the problem area to figure out the steps? Given my situation, I am worried that I might get stuck even more before I start getting the hang of it. What would your advice be in that situation?
143 replies
KPCKevin Powell - Community
Created by Abdur Rahman on 6/27/2024 in #front-end
I can't write javascript or do programming all together
@ἔρως
const string = "cookies are good for you";

const StringCounter = (str) => {
let counter = {};
const strWithoutSpaces = str.replace(/\s/g, "");
if (!strWithoutSpaces) {
return {};
}
for (let char of strWithoutSpaces) {
if (char in counter) {
counter[char]++;
} else {
counter[char] = 1;
}
}
return counter;
};

console.log(StringCounter(string));
const string = "cookies are good for you";

const StringCounter = (str) => {
let counter = {};
const strWithoutSpaces = str.replace(/\s/g, "");
if (!strWithoutSpaces) {
return {};
}
for (let char of strWithoutSpaces) {
if (char in counter) {
counter[char]++;
} else {
counter[char] = 1;
}
}
return counter;
};

console.log(StringCounter(string));
143 replies
KPCKevin Powell - Community
Created by Abdur Rahman on 6/27/2024 in #front-end
I can't write javascript or do programming all together
How about if you don't know if you should write a loop or not? I mean there was also the same situation I ran into, Or you just keep searching relevant
143 replies
KPCKevin Powell - Community
Created by Abdur Rahman on 6/27/2024 in #front-end
I can't write javascript or do programming all together
Makes sense,
143 replies
KPCKevin Powell - Community
Created by Abdur Rahman on 6/27/2024 in #front-end
I can't write javascript or do programming all together
const string = "Cookies are good for you"
const stringCounter = (str)=>{
let count={};
if(str){

}
return count;
}
const string = "Cookies are good for you"
const stringCounter = (str)=>{
let count={};
if(str){

}
return count;
}
I am stuck here, I know the next syntax should be "loop" but I have no idea what to write
143 replies
KPCKevin Powell - Community
Created by Abdur Rahman on 6/27/2024 in #front-end
I can't write javascript or do programming all together
1: Check if the string exist or not 2: if it doesn't exist, return nothing 3: if it does exist Take each character from string 4: Count each of them 5: whenever the same character comes up, Count it again 6: at the end of the string return all of the list counted charecter
143 replies
KPCKevin Powell - Community
Created by Abdur Rahman on 6/27/2024 in #front-end
I can't write javascript or do programming all together
If the string exists I need to check character
143 replies
KPCKevin Powell - Community
Created by Abdur Rahman on 6/27/2024 in #front-end
I can't write javascript or do programming all together
I wrote that in 3rd list, Didn't I?
143 replies
KPCKevin Powell - Community
Created by Abdur Rahman on 6/27/2024 in #front-end
I can't write javascript or do programming all together
mmm, not yet
143 replies
KPCKevin Powell - Community
Created by Abdur Rahman on 6/27/2024 in #front-end
I can't write javascript or do programming all together
1: Check if the string exist or not 2: if it doesn't exist, return nothing 3: if it does exist, Count all of the characters and remember it 4: whenever the same character comes up, Count it again 5: at the end of the string return all of the list counted charecter
143 replies
KPCKevin Powell - Community
Created by Abdur Rahman on 6/27/2024 in #front-end
I can't write javascript or do programming all together
but again I know that from watching tutorials, so it kinda seems fake knowing that, idk maybe my approach to that is wrong
143 replies
KPCKevin Powell - Community
Created by Abdur Rahman on 6/27/2024 in #front-end
I can't write javascript or do programming all together
I would do if (str === true), if it returns false, then it means no string exist
143 replies
KPCKevin Powell - Community
Created by Abdur Rahman on 6/27/2024 in #front-end
I can't write javascript or do programming all together
How did do it?
143 replies
KPCKevin Powell - Community
Created by Abdur Rahman on 6/27/2024 in #front-end
I can't write javascript or do programming all together
1: Count each character and remember it 2: whenever the same character comes up, Count it 3: and then after ending the string return all of the list counted charecter
143 replies
KPCKevin Powell - Community
Created by Abdur Rahman on 6/27/2024 in #front-end
I can't write javascript or do programming all together
Was it good enough?
143 replies
KPCKevin Powell - Community
Created by Abdur Rahman on 6/27/2024 in #front-end
I can't write javascript or do programming all together
1: Approach the bottle 2: Open your hands 3: Now wrap your hands around the bottle 4: Grab it 5; Put your fingers around the cap 6: Rotate the cap counterclockwise to unscrew it 7: Place that bottles opening near your mouth 8: tilt that bottle 9: Now drink based on your needs
143 replies
KPCKevin Powell - Community
Created by Abdur Rahman on 6/27/2024 in #front-end
I can't write javascript or do programming all together
okay okay
143 replies
KPCKevin Powell - Community
Created by Abdur Rahman on 6/27/2024 in #front-end
I can't write javascript or do programming all together
does that sound good, I made it into one
143 replies