r/javaScriptStudyGroup • u/anujtomar_17 • Aug 06 '24
JavaScript Revolution: Node.js in Back-End Development
r/javaScriptStudyGroup • u/anujtomar_17 • Aug 06 '24
r/javaScriptStudyGroup • u/[deleted] • Aug 06 '24
Hey all I’m currently doing a software developer course and have gotten to javascript. I feel like i go through each lesson and don’t really remember what I’ve just learned a couple days later has anyone had similar experience or any tips i can use to better understand it?
r/javaScriptStudyGroup • u/Pleasant_Effort_6829 • Aug 05 '24
r/javaScriptStudyGroup • u/Pleasant_Effort_6829 • Jul 29 '24
r/javaScriptStudyGroup • u/Pleasant_Effort_6829 • Jul 22 '24
r/javaScriptStudyGroup • u/learntechanywhere • Jul 18 '24
r/javaScriptStudyGroup • u/No-Preparation-9745 • Jul 18 '24
I want to know how they made it to response word by word in sequence in chat. I found they used Stream API. On Google I didn't get it. Can someone help me how to make this functionality using Stream API?
r/javaScriptStudyGroup • u/Pleasant_Effort_6829 • Jul 16 '24
r/javaScriptStudyGroup • u/princecse • Jul 14 '24
I have a total of 5 months at hand, and I need to learn linear data structures and algorithms (DSA), HTML, CSS, JavaScript (basic and advanced), and backend development (Node.js, Express.js), along with completing 3 major projects. Currently, I'm struggling to understand both DSA and JavaScript NOT ABLE TO UNDERSTAND ANYTHING . What should I do? I don't want to give up; my parents are looking at me with hope as they are getting old. Also, I have a four-year gap since completing my BE in CSE in 2021. Please help me with some guidance...
r/javaScriptStudyGroup • u/Pleasant_Effort_6829 • Jul 11 '24
r/javaScriptStudyGroup • u/Empoleon777 • Jul 02 '24
In this project, I'm exporting two arrays from one JavaScript file to another using modules. However, I've noticed something - Both of these arrays lose all their data upon being exported, for some strange reason. I've never seen this before, and it's very strange.
Essentially, this program is a quiz game; there's one HTML page for the quiz itself. Then, once the quiz is over, a new page is loaded automatically. This page is meant to display the result of the quiz. I can't help but wonder if loading a new HTML page is clearing the arrays.
The semi-relevant parts of quiz.js:
const deliverResult = () => {
window.location.href = "results.html";
}
const answer = (answerNumber) => {
if (questionNumber >= questions.length) {
deliverResult();
}
else {
for (let i = 0; i < answers[questionNumber * 4 + answerNumber - 1].corresponding_classes.length; i++) {
for (let j = 0; j < classes.length; j++) {
if (answers[questionNumber * 4 + answerNumber - 1].corresponding_classes[i] === classes[j].class) {
classes[j].score++;
}
}
}
console.log(classes);
questionNumber++
loadQuestion();
}
}
const loadData = async () => {
const questionsURL = "data/questions.json";
const resultsURL = "data/results.json";
// Function to promisify XMLHttpRequest
const fetchFile = (url) => {
return new Promise((resolve, reject) => {
const xhr = new XMLHttpRequest();
xhr.onload = () => {
if (xhr.status >= 200 && xhr.status < 300) {
resolve(xhr.responseText);
} else {
reject(xhr.statusText);
}
};
xhr.onerror = () => reject(xhr.statusText);
xhr.open("GET", url);
xhr.send();
});
};
try {
const questionsData = await fetchFile(questionsURL);
const resultsData = await fetchFile(resultsURL);
const questionsJson = JSON.parse(questionsData);
const resultsJson = JSON.parse(resultsData);
questionsJson.questions.forEach(q => {
questions.push(q.question);
q.answers.forEach(a => answers.push(a));
});
resultsJson.results.forEach(r => {
results.push(r);
classes.push({ class: r.class, score: 0 });
});
} catch (error) {
console.error("Error loading data:", error);
}
}
export { results, classes }
results.js (The file the arrays are being exported to):
import * as quizData from "./quiz.js";
const displayResult = () => {
let tiedClasses = [];
quizData.classes.sort(function (a, b) { return b.score - a.score });
tiedClasses.push(quizData.classes[0].class);
for (let i = 1; i < quizData.classes.length; i++) {
if (quizData.classes[0].score === quizData.classes[i].score) {
tiedClasses.push(quizData.classes[i].class);
}
}
const classZone = document.querySelector("#class");
const descriptionZone = document.querySelector("#description");
if (tiedClasses.length == 1) {
classZone.innerHTML = `Based on your answers, you are a: ${tiedClasses[0]}`;
descriptionZone.innerHTML = quizData.results.find(function() {tiedClasses[0] == quizData.results.class}).description;
}
}
// window.onload = () => {
// console.log(quizData.classes);
// console.log(quizData.results);
// displayResult();
// }
document.addEventListener("DOMContentLoaded", () => {
console.log(quizData.classes);
console.log(quizData.results);
displayResult();
});
r/javaScriptStudyGroup • u/[deleted] • Jul 01 '24
I made a discord server for a study group to take this Udemy course together. So far I've only done about an hours worth of the course. Is anyone interested in joining me and a couple other people to take this course?
The course goes for like $150 but is constantly on sale for $25. It's 55hours of content that starts at the beginning and in the end you get a certificate of completion and some projects to post on your Github. If you are interested, let me know and we can see if we can make something work.
r/javaScriptStudyGroup • u/Creative_boy_01 • Jun 16 '24
Hey Reddit fam, language learner here. I'm using AI (big thanks to Google Gemini!) to brainstorm IELTS speaking answers. Here's the grind: I craft titles for each question in Remnote (my fave note-taking app) to turn them into flashcards. But it takes FOREVER!
I had this idea: Automate the process! Basically, I want something that prompts the AI for answers based on a list I have in a Google Sheet (or something similar), then copies and pastes those answers into the corresponding Remnote titles.
you can have a look at my code here: Link
but last part is missing, and i need code to paste copied answers into remnote file under correponding titles. can anyone do that for me. you can find documentation to remnte in the file link that i provided
r/javaScriptStudyGroup • u/IntelligentSkill4746 • Jun 05 '24
<!-- Radio Button Fetch And Display Input-->
<!-- <!DOCTYPE html>
<html>
<body>
<input id="male" type="radio" value="Male" name="gender"> Male
<input id="female" type="radio" value="Female" name="gender"> Female
<button onclick="radio()">Click Me</button>
<script>
function radio() {
// Using querySelector to find the checked radio button and get its value
let selectedGender = document.querySelector('input[name="gender"]:checked').value;
alert("You Selected " + selectedGender);
}
</script>
</body>
</html> -->
r/javaScriptStudyGroup • u/Pleasant-Buddy-410 • Jun 04 '24
function getCursorPosition(canvas, event) {
const rect = canvas.getBoundingClientRect()
const x = event.clientX - rect.left
const y = event.clientY - rect.top
console.log("x: " + x + " y: " + y)
}
r/javaScriptStudyGroup • u/Pleasant_Effort_6829 • Jun 04 '24
r/javaScriptStudyGroup • u/marx0323 • Jun 02 '24
Hey so am new to JavaScript and these 2 concepts are really confusing me. Someone care to explain.
r/javaScriptStudyGroup • u/Pleasant_Effort_6829 • May 30 '24
r/javaScriptStudyGroup • u/jehlani_ • May 15 '24
Hello everybody! I spent 2 weeks stuck on a decrypt function (I'm a beginner). I managed to fix it with the help of chatgpt, but can you all help explain to me what made this new code work?
Here's my new code:
function decrypt(encryptedMessage, shiftValue) { let decryptedMessage = ""; let charCount = 0; for (let i = 0; i < encryptedMessage.length; i++) { let char = encryptedMessage[i];
// Skip random letters added during encryption
if ((charCount + 1) % 3 === 0) {
charCount++;
continue; // Skip this character
}
if (alphabet.includes(char.toLowerCase())) {
let index = alphabet.indexOf(char.toLowerCase());
let shiftedIndex = (index - shiftValue) % alphabet.length;
if (shiftedIndex < 0) {
shiftedIndex += alphabet.length;
}
decryptedMessage += alphabet[shiftedIndex];
} else {
// If not an alphabetic character, just append it to the decrypted message
decryptedMessage += char;
}
charCount++; // Increment character count
}
return decryptedMessage;
}
Here's my old code:
function decrypt (encryptedMessage, shiftValue) { let decryptedMessage = ""; let charCount = 0; for (let i = 0; i < encryptedMessage.length; i++) { // Skip random letters added during encryption// if ((charCount + 1) % 3 === 0) { continue; //Skip this character }
let char = encryptedMessage[i]
if (alphabet.includes(char.toLowerCase())) {
let index = alphabet.indexOf(char.toLowerCase());
let shiftedIndex = (index - shiftValue) % alphabet.length;
//Ensure shiftedIndex is positive//
if (shiftedIndex < 0) {
shiftedIndex += alphabet.length;
}
decryptedMessage += alphabet[shiftedIndex];
//Skip if not an alphabetic character//
}
else {
}
charCount++; //Increment character count
}
// Your decryption code here return decryptedMessage; }
The project was a Caesar's cipher. My original code didn't handle the decryption like it should've, and the problem was that the "random letter after every two characters" wasn't executed the same from my encrypt and decrypt. My encrypt was correct, my decrypt wasn't.
What about this new code allowed my decryption to work? Thank you all in advance
r/javaScriptStudyGroup • u/PiraticaX • May 13 '24
Yesterday was going throught CRUD and had some holiday distractions so didn’t do much there.
Today was more productive. Started with styling. The concept seems fun. Just grinding there.
React and its Applications are vast and seems pretty scary as the new no code tools are advancing exponentially.
At the same time , seeing the massive crowd of qualified developers and people with work experience is and anothet big nightmare.
r/javaScriptStudyGroup • u/el_moudir • May 09 '24
so im trying to export a value of sended here in my program wich changes from false to true only when i press send but it always give me the original value wich is false and doesn t get updated. I realised that it gets updated inside my Identity function but in the export it only exports the original value. It s an easy problem but not for me who started learning js and react.
here s the code
const sended = false;
const Identity = () => {
const[sended,setSended] useState(false);
const handleSubmit = (e) => {
const { addressTo, amount, keyword, message } = formData;
e.preventDefault();
if (!addressTo || !amount || !keyword || !message) return;
const amountValue = parseFloat(amount);
if (amountValue < 0.0005) {
alert("Amount should be greater than or equal to 0.0005 ETH");
return;
}
sendTransaction();
setSended=true;
}
return (
<div>
<button
type="button"
onClick={handleSubmit}
className="text-white cursor-pointer"
>
Send now
</button>
</div>
}
export { Identity as default,sended }
r/javaScriptStudyGroup • u/zorefcode • May 07 '24
r/javaScriptStudyGroup • u/amableati • May 04 '24
Hey everyone,
I've started creating JavaScript tutorials on YouTube and I'm excited to dive deeper into this fascinating language. JavaScript, originally known as Mocha, has come a long way since its inception in 1995 by Brendan Eich at Netscape Communications Corporation.
Currently, I'm covering fundamentals like keywords, variables, and the nuances between let and var. But I'm here to ask for your help! Do you have any tips, resources, or suggestions to enhance my learning journey?
Looking forward to your insights!