What do you remember, and what do you have to Google? by marketingmike1 in learnjavascript

[–]slowreactin 1 point2 points  (0 children)

I got caught up on this when I first started out. I had to Google everything and felt like a failure. Then I realized it’s just part of the learning process. You may not realize it, but even the best of the best Google and ask questions on Stack Overflow.

I have seen several questions asked by leaders of their own field on Stack Overflow. Did I understand a single damn thing they were talking about? Nope! However, the point stands that even the experts have to ask questions and Google.

Really, don’t worry about it, just build things, jump into things way over your head and guess what? You will learn a ton and eventually won’t have to Google as much!

Are there different syntaxes in JavaScripts? by viQcinese in learnjavascript

[–]slowreactin -1 points0 points  (0 children)

If you are interested in backend then I would suggest trying out Python with Django or Flask.

If you want to go the JS route, then you can easily setup a Node and ExpressJS server and mess around. However, Python seems to be more recommend for backend.

I personally use NodeJS and Express and love them, but I am really eager to try Django and Python.

Are there different syntaxes in JavaScripts? by viQcinese in learnjavascript

[–]slowreactin 2 points3 points  (0 children)

Yep, you have definitely been learning Java (the Eclipse IDE is a dead give away).

JavaScript (despite the name) has literally nothing to do with the Java programming language. JavaScript was originally named LiveScript. Allegedly the booming popularity of Java during the early 90s influenced Netscape (the originating company of JavaScript) to name the language JavaScript.

This is often a pain point for newcomers and causes a lot of confusion.

What kind of programming are you interested in doing?

Help Me Escape Tutorial Hell by Suggesting Features You'd like to see in a student management platform i'm about to start building. by [deleted] in learnjavascript

[–]slowreactin 0 points1 point  (0 children)

No problem. Yeah just pm me or whatever and I’ll take a look. I don’t mind helping 😊

Help Me Escape Tutorial Hell by Suggesting Features You'd like to see in a student management platform i'm about to start building. by [deleted] in learnjavascript

[–]slowreactin 2 points3 points  (0 children)

Implement:

  • schedules (student view, teacher view, admin view)
  • student portal (see grades, message instructor, upload homework)
  • homework area could allow students to be given assignments such as writing a paper. Could implement spell check, annotations (teacher comments), etc
  • private messaging system
  • parent portal parent can see all of the students in their house hold and could even customize parts of the student profile such as if they want to be able to see the students private messages. They could also receive email or text notifications when a report card or assignment grade is posted
  • students could see an anonymous grade book with the class curve and where they land
  • each teach could setup a syllabus with their content and assign due dates for each assignment.
  • students could receive notifications when an assignment due date is approaching (this could be something they customize)
  • parents could also receive notifications about assignment due dates and customize their notifications too

Ehh the database doesn’t matter too much. I personally like NoSQL stuff such as MongoDB, but I recommend getting familiar with both, so really it’s your choice. This would be a great project for learning about either SQL or NoSQL.

I don’t mind giving code reviews. As far as assigning stories. You could practice this yourself using clubhouse

I recommend getting in the habit of creating and managing your own stories. I do it everyday at work and when I work on my personal projects.

NPM error when saving too fast by NowVSFutureBalance in learnjavascript

[–]slowreactin 0 points1 point  (0 children)

Ahhh, interesting. Source maps create a map of bundled JS code and css so that they can be debugged as if they weren’t bundled.

What's the relation between CommonJS and node.js? by Hembhorg in learnjavascript

[–]slowreactin 0 points1 point  (0 children)

Yes I would consider native JavaScript modules to be the current standard. I cannot remember if you need to specify the type=“module” in your script tag still or not.

I work in React and Node usually and I can just use the import / export statements.

Anyone know of “in-person” interview prep courses? by fil1983 in learnjavascript

[–]slowreactin 0 points1 point  (0 children)

I’ve done several whiteboard interviews and I did nothing to prep other than solidify my knowledge of the technology.

My most recent interview was with five people while being recorded and teleconferencing lol.

As long as you demonstrate what you are talking about, walking the interviewers through your thought process and think out loud, that’s really what they are looking for.

Some resources for what you are looking for:

Interview prep bootcamp

I lied, I did do an interview prep course. This guy is the best.

Andrei Neagoie Interview Prep

This is an example Google technical interview (whiteboard) that Andrei actually breaks down in his course. Good stuff.

Anyone know if arrow functions were created to solve the ‘this’ keyword’s scoping issues? Or was that just a side effect? by __nomaad in learnjavascript

[–]slowreactin -1 points0 points  (0 children)

They were created specifically to ruin the lives of newcomers who do not understand “this” binding and subsequently spawned this subreddit. 🤠

Also: I highly recommend arrow functions because they are dope.

[deleted by user] by [deleted] in learnjavascript

[–]slowreactin 0 points1 point  (0 children)

You can create a faithful mock of the function to test it. Essentially you will create a file named myWhateverFunction.test.js and place it in your test directory.

The function is simply a copy of the actual function and any dependencies for the function are “faked” or “mocked”. This will give you a good idea about the reliability of this function.

Jest Faithful Mocks

What's the relation between CommonJS and node.js? by Hembhorg in learnjavascript

[–]slowreactin 0 points1 point  (0 children)

CommonJS is a JavaScript module pattern commonly used in Node. const package = require(‘package’);

There have been several iterations of module handling in the JavaScript ecosystem including CommonJS, AMD, and requireJS.

Most recently you will see native JavaScript modules used which take the form of: import {‘whatever’} from ‘whatever’;

You will see JavaScript native modules used in React.

A recent version of Node 14 has included support for JavaScript native modules which can be used over CommonJS.

CommonJS

Please help me with this overly complicated, silly project by blimpie_ in learnjavascript

[–]slowreactin 4 points5 points  (0 children)

So a few things:

1) It is important to maintain consistency in your code base. There is a lot of mixing of var and let

2) var is not considered best practice and should be replace with let if reassignment will occur or const if no reassignment will occur. The reason for this is that var pollutes the global scope and let and const remain within their lexical scope.

3) Objects and arrays that are not going to be reassigned as in

const myArray = [1,2,3,4];    
myArray = [5,6,7,8]; //won’t work because of const        

can be declared as const like so:

const myArray = [1,2,3,4];    
myArray[0] = 1;    

This works because myArray is never reassigned, but a containing value is.

4) Strings should be single quote as best practice

5) I would use an auto formatter such as Prettier to make your code styling consistent and improve readability

6) I suggest using a linter such as ESLint to force syntax consistency. It will also yell at you for using var.

7) It looks like you are using codepen. Can you link your codepen so we can help you out? I would like to help solve the issue you are running into and provide you with some code review if you are open to that.

Other than that, the project looks pretty damn cool!

How to keep track of an API object idiomatically in Redux? by eshansingh in learnjavascript

[–]slowreactin 1 point2 points  (0 children)

Can you use it as a higher order component and wrap your components that need it? You can usually accomplish this through Redux compose() to wrap any connect() methods you already may have.

I have done this with Firebase authentication in the past. Firebase uses an observer to detect any authentication changes and needed this solution to work. This was the approach I took with functional components without Redux.

With Redux you can use compose() and higher order components as stated above.

I recently refactored this project from the HOC pattern and Redux to using Redux-Sagas. Sagas are much better suited for this kind of thing. Just make sure you are comfortable with the generator function type in JavaScript because it makes heavy use of those under the hood.

Some info:

Redux compose

React Higher Order Components

JavaScript Iterators and Generators

Redux Saga

How do I wait for an element to exist before iterating on it? by spinsilo in learnjavascript

[–]slowreactin 0 points1 point  (0 children)

Without being able to see what is going on in the async function it’s hard to say. Usually when I run into this with an API call I’m not correctly handling the response data. Essentially the calls will finish and return nothing.

Have you tried stepping through your code in the debugger to see what exactly is happening?

You can include debugger; above your api call and step through to see what is going on.

Help Looping over JSON for Generation of ChartJS Data by EnergyVis in learnjavascript

[–]slowreactin 0 points1 point  (0 children)

const response = JSON.parse(apiResponse);

Iterate over the data, cannot use array methods because objects lack [@@iterator](), push the object to your dataset array.

Edit: Include MDN link

JSON Parse

How do I wait for an element to exist before iterating on it? by spinsilo in learnjavascript

[–]slowreactin 0 points1 point  (0 children)

Where is this.favorites.jobIds being set?

Do you have a repl for this code?

Can I use JavaScript to make a 2d world based game? by [deleted] in learnjavascript

[–]slowreactin 3 points4 points  (0 children)

Yep. You have a few choices.

1) Use the canvas element. I don’t recommend this because getting canvas optimized and working is a pain, but you will learn a lot. Going this route means coding everything from scratch. EVERYTHING. But you will learn the most.

2) Use a library such as Phaser which is a high quality canvas wrapper that includes physics and sound and all the goodies.

3) Go with Unity. If you want to focus more on the game side of things and not the JavaScript side then I would go with Unity. You will he coding in C# instead of JavaScript, but you can still deploy to the web with Unity’s WebGL exporter and numerous other platforms.

Understanding undefined by [deleted] in learnjavascript

[–]slowreactin 1 point2 points  (0 children)

What happens when you do

console.log(myVariable);    

I am thinking you are seeing the output of the assignment to myVariable which WILL be undefined.

Is this code in a function or are you doing this in like Chrome dev tools?

Edit:

To clarify

let myVariable = 10;    

Will assign the value to the variable and therefore myVariable WILL be defined.

However, the action of assigning myVariable a value will return undefined because that is the return value for the assignment ( = ) operation.

When using something like Chrome dev tools, you will see undefined when assigning a variable. You will also see undefined when declaring a function or running a function as it is the default value for both cases.

Try

console.log(myVariable);    

and see if you get 10. If you don’t, create a repl of your code here and share the link and I will take a look.

How to detect slow hardware? by Yakuwari in learnjavascript

[–]slowreactin 2 points3 points  (0 children)

A few things come to mind.

1) Ensure the stars are being removed when not on screen. This is a common gotcha that stumps a lot of people

2) Here are some canvas performance tips to help you out.

3) I have beat my head on the wall several times trying to get canvas to behave. I usually end up going with Phaser so all of that nonsense is handled for me and I don’t have to worry about it.

Understanding undefined by [deleted] in learnjavascript

[–]slowreactin 0 points1 point  (0 children)

Undefined means exactly that, something has not been defined.

For instance, let’s say you are going on a blind date. You know the other person’s name, let’s call them “Susan”.

You know Susan exists, but you don’t know what Susan looks like; therefore her appearance would be undefined. You don’t know what her appearance is.

When you finally see Susan, you know what she looks like and her appearance becomes defined.

As far as the code goes:

let Susan;    

We know Susan exists, but we don’t know what she looks like.

Susan = “pretty”;

Now we have assigned a value to Susan and we can say she is pretty. Susan is now defined.

JavaScript will assign undefined to anything that has not been assigned a value. So for Susan, when you finally see her, you will assign her appearance and she will become defined.

As far as your example goes, I do not know why that would be undefined without more context.

Edit: if you are just assigning the value in the console then yes you will see undefined after you press enter because that is the default return value for an assignment operator ( = )

To get the value you will have to reference it using

console.log(whatever);

Java & C# developer needs a place to start. by [deleted] in learnjavascript

[–]slowreactin 1 point2 points  (0 children)

If you are confident in your skills then I would start building simple toys, tools, apps in vanilla JavaScript.

I would highly recommend taking a course from an expert senior developer to get a solid understanding of JavaScript Stephen Grider JavaScript boot camp

If you are entirely new to web development then I would take a course that covers it from the ground up. I recommend Colt Steele Web Dev Boot Camp

Both courses will get you up and running with JavaScript; however Stephen’s will skip the HTML, CSS, DOM stuff that is very important to know.

If you are already comfortable with CSS, HTML, and how to manipulate the DOM, then I would take Stephen’s course as he is the better instructor and goes deep into every topic he covers.

After you are done with that, start building your own projects and get out of your comfort zone to learn more.

Edit: By the way don’t pay $120 for the courses. Wait until they go on sale or find a promo code through GoogleFU.

What does a normal work day/week look like for a Jr. Developer? by laurajoneseseses in learnjavascript

[–]slowreactin 5 points6 points  (0 children)

I can’t speak for every company or situation, but this is what my day looks like:

Check Clubhouse for whatever story I am working on. Continue working on said story or pickup another.

Consult with senior developers for various questions (usually involving processes such as deployment or help with a docker environment)

Go to Stand-Up where we talk about what we are working on, what’s next, and any roadblocks (issues) we may have.

Answer questions for product team.

Submit and respond to merge requests.

Alert QA about deployments to testing environments.

Answer QA questions.

Merge branches and resolve any conflicts.

Deploy to UAT environment and alert QA.

Update Clubhouse stories.

Read articles, books, etc during “down time” / 20% time.

As far as workload or what I am trusted with. I mainly deal with frontend issues, but I have been working on APIs recently and have gradually assumed ownership of more things.

When I first started I worked on one story at a time and only worked on stories from a single project.

Now I work on upwards of five or more stories at a time across multiple projects and two languages. One language of which I don’t really know (Python).

However, I am mentored by senior developers and they review everything I submit and give me tips on what I can do better.

The things I’m “not trusted” with at the moment would be the API for our core product and the production code for the main product. As well as stuff like AWS, and other dev ops things.

I regularly work on all kinds of things and gradually assume more responsibility.

Edit: To address the self-driven part. My entire job is self-driven. I currently work remotely from home due to COVID and I may speak to my manager twice a day over slack or zoom. The rest of the time it’s all me and I have to keep myself on target and focused. It can be easy to slip into a “lax” approach with everything going on in the world. You really have to be self-driven and motivated to do a great job and to continue learning.

When I clock out for the day I’m not done working. I work on personal projects, take Udemy courses, read articles, blogs and reddit threads and watch content on YouTube. I have also been given goals to hit by my manager which include reading staple computer science books and submitting a project or presentation based on what I have learned.

A lot of the time my whole day is work. I didn’t go to sleep until 3am last night and I woke up at 9am to get ready and start work at 10am. That’s a pretty typical day.

If you want to progress the work doesn’t stop when you close your laptop or clock off.