r/javaScriptStudyGroup • • Apr 24 '22

What is DocumentFragment and createDocumentFragment() in JavaScript

Thumbnail
codetopology.com
2 Upvotes

r/javaScriptStudyGroup • • Apr 21 '22

Stack and Queue UI implementation

2 Upvotes

I was asked to implement stack and queue along with its UI representation during the live coding round of an interview for a frontend developer role. This was asked to test the candidates array manipulation skills and also how "last in first out" works in stack and "first in first out" works in queue. Here's an implementation of the same.
Link: https://www.youtube.com/watch?v=LmvOaGcs9TI


r/javaScriptStudyGroup • • Apr 13 '22

2022 Career Goals

2 Upvotes

What are your career goals in programming this year and what are you doing to achieve that?
Let's talk


r/javaScriptStudyGroup • • Apr 12 '22

My textbox won't let me input anything.

2 Upvotes

I'm trying to create an input-based typing game, but my textbox won't work. How do I fix this? Here's the link to the entire game, but the issues are in the file "screen1.js". Any help is appreciated!

I know it's a very poorly made game. It's for a project. Also ignore the other games, I'm only focused on the typing game.


r/javaScriptStudyGroup • • Apr 07 '22

Good materrial to go from Java to JS

2 Upvotes

I came from java and wanna learn JS as soon as possible because it's awesome.

I wanned to know if there is some good material on pdf or something for me that already know the sintax java and I presume that both has a very similar sintax

can you help me?


r/javaScriptStudyGroup • • Mar 19 '22

JavaScript — Using The Spread Operator (…)

Thumbnail
medium.com
2 Upvotes

r/javaScriptStudyGroup • • Mar 07 '22

VS Code extension helpful for web development

2 Upvotes

Hello everyone,

Here is a list of some useful VSCode extensions which may help in web development.

I hope it will help someone. Also if you know of any other good VSCode extension, Please share it. I would be grateful.

Thanks

https://farhan-tanvir.medium.com/10-useful-vs-code-extensions-to-make-life-easier-part-2-a295609788e0


r/javaScriptStudyGroup • • Feb 03 '22

Is there a more efficient way to call the same event handler for multiple DOM elements

2 Upvotes

Hello, apologies for the code snippet its not complicated just very repetitive

I included some images of my mock up portfolio page and tried my best to explain what im trying to achieve. Im trying to make an section that displays an image with the projects title in the middle, and 4 buttons. When clicked it will show a paragraph & hide the title, when you move the mouse it will switch back.

(1) My questions are.. is there a more efficient way to implement this rather than having to assign variables to each element and calling onclick/onmouseout event listeners for each variable. If I wanted to add more sections like this it would be very tedious.

(2) At first the paragraph wouldn't show unless unless I press a button twice the first time round. I found that calling the function at least once for each button fixed this, but I don't understand why.

(3) I also found it strange how I could not get this to work unless I passed the function inside an anonymous function instead of directly assigning the function like so:

button1.onclick = togggleParagraph(heading, paragraph1) why is this?

<ul>
  <li id = "challenges1">Challenges</li>
  <li id = "solutions1">Solutions</li>
  <li id = "features1">Features</li>
  <li id = "tech1">Technologies</li>
</ul>

<figure>
  <img id = "project1" src="resources/images/project2.jpg">
  <h2 id = "one">Martial Arts Club</h2>
  <p id = "p1.1">Lorem ipsum ....</p>
  <p id = "p1.2">Lorem ipsom ....</p>
  <p id = "p1.3">Lorem ipsom ....</p>
  <p id = "p1.4">Lorem ipsum ....</p>
</figure>

<script>
/* Assigning elements to variables */

let heading = document.getElementById('one');
let button1 = document.getElementById('challenges1');
let paragraph1 = document.getElementById('p1.1');
let button2 = document.getElementById('solutions1');
let paragraph2 = document.getElementById('p1.2')
let button3 = document.getElementById('features1');
let paragraph3 = document.getElementById('p1.3');
let button4 = document.getElementById('tech1');
let paragraph4 = document.getElementById('p1.4');

/* If the title is showing and paragraph is hidden, 
show the paragraph and hide the title. Otherwise show
the title and hide the paragraph. */

function toggleParagraph(heading, paragraph) {
    if (paragraph.style.display === 'none' && 
    heading.style.display === 'block') {
      heading.style.display = 'none';
      paragraph.style.display = 'block';
    } else {
      heading.style.display = 'block';
      paragraph.style.display = 'none';
    }
}

/* If the paragraph is showing and title is
hidden, show the title and hide the paragraph. */

function hideParagraph(heading, paragraph) {
  if (paragraph.style.display === 'block' &&
  heading.style.display === 'none') {
    paragraph.style.display = 'none';
    heading.style.display = 'block';
  }
}

/* Button requires 2 clicks to toggle paragraph.
One solution was to call the function once before 
assigning it to event listeners */

toggleParagraph(heading, paragraph1);
toggleParagraph(heading, paragraph2);
toggleParagraph(heading, paragraph3);
toggleParagraph(heading, paragraph4);

button1.onclick = function () {
  toggleParagraph(heading, paragraph1)
};
button2.onclick = function () {
  toggleParagraph(heading, paragraph2)
};
button3.onclick = function () {
  toggleParagraph(heading, paragraph3)
};
button4.onclick = function () {
  toggleParagraph(heading, paragraph4)
};

button1.onmouseout = function () {
  hideParagraph(heading, paragraph1)
};
button2.onmouseout = function () {
  hideParagraph(heading, paragraph2)
};
button3.onmouseout = function () {
  hideParagraph(heading, paragraph3)
};
button4.onmouseout = function () {
  hideParagraph(heading, paragraph4)
};
</script>

r/javaScriptStudyGroup • • Feb 03 '22

JavaScript <style> issue (help)

2 Upvotes

Hi guys! i have an small code snippet and for some reason i can't make the <style> in the JS to work? i can DM the code snippet if u want to help me,. i need an better eye perhaps u got it :)

- Cheers


r/javaScriptStudyGroup • • Dec 10 '21

String formatting in JavaScript

Thumbnail
tutorialstonight.com
2 Upvotes

r/javaScriptStudyGroup • • Dec 05 '21

Onbeforeunload when window closes but not reloads

2 Upvotes

I’m trying to use onbeforeunload on c# and Js for the user to make sure that he/she have saved whatever they are working on. So, the problem is when the user reload the page the pop up appears even though they didn’t change anything in the page. Also, I want pop up to appear whenever the user is closing the page and has made changes only. Not when it reloads.


r/javaScriptStudyGroup • • Dec 02 '21

Understanding Service Workers in JavaScript | Offline-experience

Thumbnail
youtu.be
2 Upvotes

r/javaScriptStudyGroup • • Nov 29 '21

Some methods/functions doest work proper in javascript - Help

2 Upvotes

Hello,

Im pretty new with javascript and im following a course.

I use visual code studio and im doing everything like he does but for example i cant possible make ex: arr.lenght to function, but if i copy / paste the same exact thing from the guides code it works this happens especially in loops ex: for (let i = 0; i < arr.lenght), in this case arr.lenght will work just if i copy/paste it.

I can assigb the arr.lenght to another value and then use that one, but not to use it directly where i need it.

Im lost and this bugs me really hard, couldnt find this issue nowhere on the internet and i really tried but i dont know where the problem s coming from... js? Visual code? Me?


r/javaScriptStudyGroup • • Nov 19 '21

How to Make API Calls in JavaScript

Thumbnail
codingtute.com
2 Upvotes

r/javaScriptStudyGroup • • Nov 19 '21

JavaScript quiz to make solid your knowledge and prepare to interview for 30 mins and 40 questions

Thumbnail proghub.io
2 Upvotes

r/javaScriptStudyGroup • • Nov 18 '21

I have an assignment in JavaScript to take data from an array in stories.js file and put them in a forum in the script.js to make a madlip can anyone help please?

2 Upvotes

The stories.js file contains the stories variable, which is an array of objects. Each object represents a story and contains a title, an array of required words, and an output method. The words array contains the types of words the visitor must provide. The words array should be used to create the form after the visitor selects a story. The output method will accept an object of words and will return the completed story. Each provided word is wrapped in a <span> tag with the class of word.

I am not sure how to use eventlisteners nor how to use nested loops to pull out the array elements from the stories.js file. I know that I can use (for example one of the stories and its words) ${stories[0].words[0]} but how do I use that in loop to fill the form?


r/javaScriptStudyGroup • • Nov 13 '21

JavaScript: Four Major Differences in var and let

Thumbnail
codetopology.com
2 Upvotes

r/javaScriptStudyGroup • • Nov 10 '21

JavaScript Basics Revisited

Thumbnail
codetopology.com
2 Upvotes

r/javaScriptStudyGroup • • Oct 04 '21

Javascript Stream: The most up to date articles, podcasts, videos, repos about Javascript (Reactjs, Node, Angular, Vue ..etc)

Thumbnail
shoufi-press.tech
2 Upvotes

r/javaScriptStudyGroup • • Aug 31 '21

I am having trouble with this problem

2 Upvotes

let proteins = ['chicken', 'pork', 'tofu', 'beef', 'fish', 'beans']; let grains = ['rice', 'pasta', 'corn', 'potato', 'quinoa', 'crackers']; let vegetables = ['peas', 'green beans', 'kale','edamame', 'broccoli', 'asparagus']; let drinks = ['juice', 'milk', 'water', 'soy milk', 'soda', 'tea']; let desserts = ['apple', 'banana', 'more kale','ice cream', 'chocolate', 'kiwi'];

I have to make a for loop that creates a meal out of all the items in the arrays.So one of the meals would need to be chicken, rice,peas,juice, and an apple. I don't want the answer but tips on what methods I can use or how I can work around this, but the answer is fine too.


r/javaScriptStudyGroup • • Aug 31 '21

Learn overview of javascript(part1)

2 Upvotes
4 votes, Sep 03 '21
4 good
0 bad

r/javaScriptStudyGroup • • Aug 28 '21

NEED HELP!

2 Upvotes

This is the array:

const campgrounds = [
{ number: 1, view: "ocean", partySize: 8, isReserved: false },
{ number: 5, view: "ocean", partySize: 4, isReserved: false },
{ number: 12, view: "ocean", partySize: 4, isReserved: true },
{ number: 18, view: "forest", partySize: 4, isReserved: false },
{ number: 23, view: "forest", partySize: 4, isReserved: true },
];

I need to create a function to find the max capacity of the campgrounds using the partySizes.

I am lost D:


r/javaScriptStudyGroup • • Aug 21 '21

Aula 4 Lógica de programação com Javascript, Funções

Thumbnail
youtube.com
2 Upvotes

r/javaScriptStudyGroup • • Jul 30 '21

How to Customise Material UI's Default Styling | JavaScript Works

Thumbnail
javascript.works-hub.com
2 Upvotes

r/javaScriptStudyGroup • • Jul 27 '21

Understanding Micro Frontends

Thumbnail
javascript.works-hub.com
2 Upvotes