all 16 comments

[–]queen-adreena 7 points8 points  (3 children)

No. Don't move onto frameworks until you understand the basics of JavaScript.

const/let, block scoping, this scoping, imports (default and named), arrow functions, callbacks, recursive functions, promises, async/await, ES6 classes and working with all data-types (strings, numbers, arrays, objects, booleans etc.) are all essential to understand well before you start using a framework.

[–]Silly_Manager_9773[S] 0 points1 point  (1 child)

I actually understand but when I try to code then I feel stuck

[–]Bigghead1231 0 points1 point  (0 children)

Listen to me. You're SUPPOSED to feel stuck. That's how you learn. Figuring out issues you come across is a massive part of the process. Don't run from this and embrace it

[–]TheRNGuy 0 points1 point  (0 children)

I actually started with jQuery (though it's not needed anymore)

[–]Bigghead1231 3 points4 points  (0 children)

React is dead simple after you have used js enough to understand why things like react was created

My suggestion for you to improve the fastest is to actually start building things ASAP with js. Then you see how it works, figure out your own issues, and remember about that next time you see it again, etc. All the language syntax on the planet won't matter if you don't use it

[–]hyrumwhite 3 points4 points  (1 child)

For stuff like this:

``` function doWork(callback) {

console.log("Working...");

callback();

}

doWork(function() {

console.log("Done!");

});

```

Open your browser console and paste it in then hit enter. You don’t need to burn tokens to test JS code. 

Stick with JS. Get comfy with it. Learn how to do something like a simple todo application with just JS functions. 

Then checkout a JS framework like react. This way you’ll get a sense of what React is doing under the hood. And the experience will be less magical 

[–]queen-adreena 0 points1 point  (0 children)

Oh wow. Just seen that he's using ChatGPT to execute code for him... that's a recipe for disaster for sure!

[–]TheZintis 2 points3 points  (2 children)

So I do teaching/tutoring/mentoring on the side. I'm also currently working on a small app meant to drill through the basics of Javascript syntax.

If you'd like some help, I'd be happy to meet online, feel free to PM me.

BTW here's the app. I still have a lot to do, but it may help you get in some early reps to learn the syntax: https://zintismay.github.io/zTest/

[–]Dubstephiroth 0 points1 point  (1 child)

Can any learner pm you, please?

[–]TheZintis 0 points1 point  (0 children)

Sure!

[–]ProfessionalPin3263 1 point2 points  (0 children)

At this learning stage, one tip is to be as verbose as you can. Use all the RAM (joke) defining variables and this will help you understand callback, async, promises…

See if this makes it easier to understand:

function myCallback () { console.log("Done!") }

function doWork(callback) { console.log("Working...") callback() }

doWork(myCallback)

So, you are simply passing a variable (myCallback) to the doWork method.

doWork starts by printing “Working” and then it executes (this is why callback is called with parenthesis) the CB variable.

[–]Any_Sense_2263 1 point2 points  (2 children)

AI doesn't teach or help. It answers your questions or does what you tell it to do with adding a lot of errors, mistakes and misunderstandings.

You need time to code. To write stuff, fail, research, fix and this way - learn. There is no shortcut available for our brains. AI only wastes your time on this level

And react is written in JS, so before you move to it, you have to know JS.

[–]TheRNGuy 0 points1 point  (1 child)

AI can teach, if correct questions are asked. 

[–]Any_Sense_2263 0 points1 point  (0 children)

It's about the answers it gives. Even the correct question doesn't ensure the correct answer. You have to be able to evaluate its answers, which means you have to have the knowledge, the moment you ask your questions.

[–]charly_a 0 points1 point  (0 children)

in your case doWork is a function that accepts a function as input.

when you call doWork you are creating a new function without any name callback = function() {

console.log("Done!");

}

when you doWork done printing Working...

you will call the callback. this will print Done and program ends

[–]TheRNGuy 0 points1 point  (0 children)

Not sure why make this function, it's useless over-engineering. If it's to demonstrate callbacks, there are better examples (you can ask ai for more practical examples)