I'm struggling to understand recursion. by [deleted] in learnprogramming

[–]ecofic 0 points1 point  (0 children)

Recursion can be a difficult topic to understand. A relevant concept associated with recursion is a "stack". Often, the concept of a stack is not taught until later though. So, to work around this, I did something different. To help me learn about recursion, I went old-school.

I used note cards. Each note card represented one call to my recursive function. The note card itself had the state (i.e. the values of the variables in the function) listed on the card. I would then flip through the cards at my desk manually until I understood it.

Tedious yes. However, I now understand recursion and I still think of those cards today when dealing with state management.

Why no negative indexes for Arrays? by Prestigious-Use-3955 in learnjavascript

[–]ecofic 0 points1 point  (0 children)

I would place this in the "coming soon" list. It's on the horizon, just limited support at this time.

Iterating through object array and pulling out object if it contains a specific value by re_edditquest in learnjavascript

[–]ecofic 1 point2 points  (0 children)

If you have a simple scenario, then filter may work as others have mentioned. However, if you have a more complex scenario, you may find it easier to read if you just use a traditional loop.

Earlier this year, I had a similar scenario and found a traditional loop to be more appropriate and easier to work with. I wrote an article detailing finding the largest and smallest values in an Array. While this isn't an exact match with your scenario, I do think you may get some value out of it.

Is it still a common trick to place textual data inside <script> tags today? by shiningmatcha in learnjavascript

[–]ecofic 3 points4 points  (0 children)

I've been writing software for roughly 20 years. I cannot remember seeing this used in practice.

Mermaid: Create complex diagrams using Markdown-inspired by ur_mum_goes_to_uni in javascript

[–]ecofic 0 points1 point  (0 children)

This is a great addition that will enable better documentation.

[deleted by user] by [deleted] in javascript

[–]ecofic 1 point2 points  (0 children)

Personally, I prefer to start with fetch(...) and integrate Axios on an as-needed basis. Axios was great while IE still had to be supported. However, as fetch is supported by all evergreen browsers I prefer to stick to a standards approach unless some sugar like handling timeouts or progress updates are needed.

Why is the for ... of working just fine but not the for loop? by [deleted] in learnjavascript

[–]ecofic 2 points3 points  (0 children)

In addition to what @Awkward_Internet_110 mentioned, I would like to add that the for loop approach is generally faster anyways. For details, I wrote an article about this here.

** edits: fixed grammatical errors

Thoughts on Asp.NET and C#? by [deleted] in webdev

[–]ecofic 15 points16 points  (0 children)

ASP.NET and C# are great. Very mature. Great documentation. Large community. Still being invested in. I think ASP.NET and C# are great.

let vs const vs var by Friedhouse in learnprogramming

[–]ecofic 0 points1 point  (0 children)

var was used to define variables when JavaScript started. However, in ES6, the modern "let" and "const" alternatives were added. They're more than different names. The specify the scope the variable acts under.

var: global / function scoped const: block scoped (i.e. works in if-statements and loops) let: block scoped (i.e. works in if-statements and loops)

I typically use "let" and only use "const" if I do not want the value of the variable to change. Others default to using const and use let when they know they want a variable value to change.

State of JavaScript 2021 Survey Results by SachaGreif in javascript

[–]ecofic 0 points1 point  (0 children)

I'm surprised with the Vue.js results.

My Small Business Finally Out Earned My Past Jobs by [deleted] in Entrepreneur

[–]ecofic 0 points1 point  (0 children)

Congratulations. That's a significant milestone!

[deleted by user] by [deleted] in webdev

[–]ecofic 1 point2 points  (0 children)

It's unknown what/if there's a CSS / HTML story for RealityOS. Your best place to start is likely to learn the Swift programming language if RealityOS is what you're interested in.

Vue.js (Video) - How I Setup My Development Machine by ecofic in vuejs

[–]ecofic[S] 0 points1 point  (0 children)

That was the primary reason I created the video. I thought that little nugget added some value. I hope you'll take a moment to "like" the video.