r/javaScriptStudyGroup • • Aug 13 '19

React Hooks - Most Used Features (+ two demo apps)

2 Upvotes

Hello everyone, React Hooks are a feature that most of the developers started using by now. If you haven't already, this is a great video to get you started - https://youtu.be/-9M9CGSd69I. :)

In this video we will explore React Hooks. React hooks allow us to provide additional features to functional components. We'll dive into useState(), useEffect() and custom hooks in great detail. useState hook allows us to store state in a functional component and useEffect hook replaces almost all of the lifecycle methods that class based components have.

Any feedback or criticism is greatly appreciated! :D

tldr of the video; why and how to use React Hooks, refactor two applications from class based components to functional ones using React hooks, explain all most important concepts of hooks along the way.


r/javaScriptStudyGroup • • Jun 02 '19

51 Most Important ReactJS Interview Questions and Answers

Thumbnail
opencodez.com
4 Upvotes

r/javaScriptStudyGroup • • Oct 17 '19

Basics and foundations of Javascript

4 Upvotes

Hi I'm a first year college student and I missed 2 weeks of school due to a funeral. This is my first time coding ever and me missing those classes really have me lost. Can anyone give me any tips and tricks for JS. Like I'm literally so lost, how to start, where to start, how to order, etc. Can you guys tell me the basics and foundations of javascript.


r/javaScriptStudyGroup • • May 26 '18

Click game - speed coding in javascript

Thumbnail
youtu.be
1 Upvotes

r/javaScriptStudyGroup • • Dec 20 '19

Dissecting A Dweet #8: Shattered Tunnel

Thumbnail
frankforce.com
1 Upvotes

r/javaScriptStudyGroup • • Mar 16 '19

Vanilla JS

Thumbnail
vanilla-js.com
2 Upvotes

r/javaScriptStudyGroup • • Aug 13 '19

Learn about promises: A code walkthrough tutorial

Thumbnail
youtu.be
3 Upvotes

r/javaScriptStudyGroup • • Jan 12 '16

Welcome to /r/javaScriptStudyGroup!

12 Upvotes

Welcome to /r/javaSctipStudyGroup!

Please comment below to introduce yourself, and please share some ideas about what you want to see in this sub...


r/javaScriptStudyGroup • • Nov 10 '17

Noob looking for help

3 Upvotes

Hi all,

I'm currently trying to code a simple JavaScript game. I'm using a children's study book called 'Creating with Code - Develop your own game' (CoderDojo). It's a step-by-step approach to create this game: http://www.nano-tips.com/nanonautspringt/

Anyway: I succeeded in creating the background and the guy. The next step is to make my guy jump... That's where I need some help. I just can't make it work... What am I doing wrong? This is the relevant part of the code:

// CONSTANTEN

var CANVAS_BREEDTE = 800;
var CANVAS_HOOGTE = 600;
var NANONAUT_BREEDTE = 181;
var NANONAUT_HOOGTE = 229;
var GROND_Y = 540;
var NANONAUT_Y_VERSNELLING = 1;
var SPATIEBALK_CODE = 32
var NANONAUT_SPRONG_SNELHEID = 20;

// INSTELLINGEN

var canvas = document.createElement('canvas');
var c = canvas.getContext('2d');
canvas.width = CANVAS_BREEDTE;
canvas.height = CANVAS_HOOGTE;
document.body.appendChild(canvas);

var spatiebalkIsIngedrukt = false;

var nanonautAfbeelding = new Image();
nanonautAfbeelding.src = 'nanonaut.png';

var achtergrondAfbeelding = new Image();
achtergrondAfbeelding.src = 'achtergrond.png';

var nanonautX = 50;
var nanonautY = 40;

var nanonautYsnelheid = 0;

window.addEventListener('keydown', onKeyDown);
window.addEventListener ('keyup', onKeyUp);
window.addEventListener('load', start);

function start() {
window.requestAnimationFrame(hoofdlus);
}



// HOOFD-LUS

function hoofdlus () {
update ();
draw ();
window.requestAnimationFrame(hoofdlus);
}

// SPELER-HANDELINGEN

function onKeyDown(event) {
if (event.keyCode === SPATIEBALK_CODE) {
spatiebalkIsIngedrukt = true;
}
}

function onKeyUp(event) {
if (event.keyCode === SPATIEBALK_CODE) {
spatiebalkIsIngedrukt = false;
}
}


// UPDATEN

// Update de Nanonaut.

function update() {
if (spatiebalkIsIngedrukt) {
nanonautYSnelheid = -NANONAUT_SPRONG_SNELHEID;
}

nanonautY = nanonautY + nanonautYsnelheid;
nanonautYsnelheid = nanonautYsnelheid + NANONAUT_Y_VERSNELLING;

if (nanonautY > (GROND_Y - NANONAUT_HOOGTE)) {
nanonautY = GROND_Y -NANONAUT_HOOGTE;
nanonautYsnelheid = 0
}
}

r/javaScriptStudyGroup • • Jan 14 '16

Well... we've got 10 readers/subscribers now...

2 Upvotes

According to the sidebar and traffic stats, we've got 10 people here now. I think that's enough to start piloting the group.

In this thread, let's come up with some basic ideas for format/first focus.

We'll vote on comments to show what suggestions we think are best for the first week (we'll call next week the first official week).

DO NOT BE AFRAID TO SHARE ANY AND ALL IDEAS. ANY AND ALL SKILL LEVELS ARE WELCOME! :)


r/javaScriptStudyGroup • • Nov 09 '17

And.... that's why you learn javascript.

2 Upvotes

So you can rid your self of Youtube subscriptions. Have fun

https://pastebin.com/RjHLEMRN


r/javaScriptStudyGroup • • Nov 09 '17

Anyone know how to do this javascript assignment? Need of help

1 Upvotes

I need help with a javascript assignment. If anyone knows how to do this, then it would be highly appreciated. I am completely lost in this. Thank you.

Develop a number guessing game using Javascript and simple HTML. The computer will select a number between 1 and 20. The player will have five tries to attempt and guess the correct number. The program will need to accept input (the player's guess) through a text field and trigger the program when the user presses a submit button. The output should display on the document object via innerHTML, textContext, or other similar method. Use your own code and do not use images from existing programs on the Web. You will be graded down heavily if you do not use your own work.

The HTML5 document will need to validate for HTML5. This does not mean you need to use HTML5 semantic tags explicitly, but the HTML5 document will need to validate the W3C validation. https://validator.w3.org/ (Links to an external site.)Links to an external site.

We will have an opportunity to build parts of the number guessing game during class exercises.

Details:

An html document and an external Javascript file. You may embed some of your Javascript into the page as necessary, but the majority of your code should be in an external file.

The computer will create a random number between 1-20. The game should start with a web page that has a text input field that asks the user to guess a number between 1-20.

The game will evaluate the user's guess and determine if it is less than, equal to, or greater than the computer's number. If it is equal to the computer's number than the user wins and the game ends.

The user will be allowed five guesses. After that point then the computer wins and the game ends. You can end a game by causing a submit button to be disabled.

Accept the input by using input text fields and buttons. Output should appear to the document object via innerHTML or other similar method.

Remember that if the player has selected the correct number, or if the player has exceeded five guesses, then the game will end. To show an "end" You will want to write text to the document object saying that the game is over.

Comment the Javascript code to describe how it is working. Include your name and date of completing the project at the top of your Javascript comments. Use your own code and do not use images from existing programs on the Web.


r/javaScriptStudyGroup • • Apr 01 '18

How to code atari breakout google image style - Part 2 ❗️❗️TRY OUT THE SCRIPT LINKED IN THE DESCRIPTION❗️❗️

Thumbnail
youtu.be
1 Upvotes

r/javaScriptStudyGroup • • Apr 01 '18

building projects with javascript

2 Upvotes

Hi,

As i am now getting familiar with javascript i am looking to build projects can anyone recommend me as a first project what you receommend to build or if there are any resources out there that could give me ideas.


r/javaScriptStudyGroup • • Nov 08 '17

Writing a Script that Prints out 1-500 While Concatenating it to a String

1 Upvotes

Ok. The title is not so bright. This is what I want to achieve:

The url +[1-500]+.jpg printed out

www.example.com/img/1.jpg
www.example.com/img/2.jpg
www.example.com/img/3.jpg
...
...
...
www.example.com/img/400.jpg

How I think of going about it

str1 = "www.example.com/img/
str2 = ?
str3 = ".jpg"
res = concat of str1+str2+str3

Str2 is the function that prints out 1-500. I cannot figure it out. Help!

I just started learning Javascript. From a Literature background. I thought I should let that out.


r/javaScriptStudyGroup • • Nov 06 '17

Help with Star Wars api and js

2 Upvotes

Hi,

Hope everyone is doing great :)

I am quite rusty with js and wanted to practise by pulling data from the star wars api and dynamically inserting it into divs. Specifically I am pulling planet information, using the key values to populate the " table" header(i am using css display:table). The rows of the table should be each planet + information(limited to 7 items). The script below seems to do this for the first planet but cant for the life of me figure out how to make it go through each planet and do that. Obviously feel free to laugh/mock/kudos/criticize my code, it would help me loads.

Any ideas?

Thanks everyone!

const fetchPlanets  = fetch('https://swapi.co/api/planets/');
getPlanets();
function getPlanets(){
fetchPlanets.then(
    (data) => data.json()
)
.then(
    (planetList)=> {
        let planetItems = planetList.results;
        console.log(planetItems);
        for (var i = 0; i < planetItems.length; i++) {       
            let planets = document.getElementById("planets"); 
            let tableHeader = document.getElementById("table-header"); 
            let tableRow = document.createElement("div");
            planets.setAttribute("class", "table");
            tableHeader.setAttribute("class", "table-header");
            tableRow.setAttribute("class", "table-row");
            let keyTitles = Object.keys(planetItems[0]);       
            for (var i =0; i <  keyTitles.length; i++){
                if(i < 7) {
                    let tableCellHeader = document.createElement("div");
                    let tableCell = document.createElement("div");
                    let planetData = Object.values(planetItems[i]);
                    tableCellHeader.setAttribute("class", "table-cell");
                    tableCellHeader.innerHTML = keyTitles[i].replace("_", " ");
                    tableHeader.appendChild(tableCellHeader);
                    //planetData rows
                    planets.appendChild(tableRow);
                    tableRow.appendChild(tableCell);
                    tableCell.setAttribute("class", "table-cell");
                    tableCell.innerHTML = planetData[i]; 
                }  
           }     
      }
    }
  )  

}

r/javaScriptStudyGroup • • Nov 03 '17

The most popular JavaScript tutorials

Thumbnail
hype.codes
6 Upvotes

r/javaScriptStudyGroup • • Mar 27 '24

Mastering Animated Navigation with JavaScript | Web Development Tutorial for Beginners

Thumbnail
youtu.be
2 Upvotes

r/javaScriptStudyGroup • • Mar 29 '24

Help!!

1 Upvotes

Guys, I'm an intermediate in c++ and am finding Js easy and fun, I'm doing development and need to know how much of Js I need to learn(topics) and possibly some resources and practice projects as well.


r/javaScriptStudyGroup • • Mar 06 '24

Awesome Border Animation Effects using CSS

Thumbnail
youtu.be
2 Upvotes

r/javaScriptStudyGroup • • Feb 14 '24

🌀Rotating Navigation for Seamless User Experience🚀

Thumbnail
youtu.be
2 Upvotes

r/javaScriptStudyGroup • • Feb 21 '24

🚀 Top 7 CSS & JavaScript Projects for Coders & Web Developers!

Thumbnail
youtu.be
1 Upvotes

r/javaScriptStudyGroup • • Mar 06 '24

Help regarding setTimeout functions

1 Upvotes

set Timeout (let sum = (a, b)=>{

console.log(a + b)

},3000,43,34)

why does this produce an error??

set Timeout(sum = (a, b)=>{

console.log(a + b)

},3000,43,34)
and why does this not?? why should we not use let before declaring the arrow function


r/javaScriptStudyGroup • • Mar 20 '24

🚀 Top 7 CSS & JavaScript Projects for Coders & Web Developers!

Thumbnail
youtu.be
2 Upvotes

r/javaScriptStudyGroup • • Mar 20 '24

😱Learn Everything you need to know about The JS MAP Object💯

Post image
1 Upvotes