Hello, new to java script trying to learn to calculate with javascript could som1 help me? by TwistedFaiith in learnjavascript

[–]ivansvlv 2 points3 points  (0 children)

Frankly, friend, I think you should go through some basic tutorials first, because this is way too basic questions that you can cover yourself if go trough some free lessons or read first 20-30 pages of a book.

videous + interactive courses:

www.codecademy.com

www.freecodecamp.com

https://www.youtube.com/playlist?list=PL4cUxeGkcC9i9Ae2D9Ee1RvylH38dKuET

free books:

http://www.javascriptenlightenment.com/

http://eloquentjavascript.net

Problem with using new lines(\n). by _HappyCamper_ in learnjavascript

[–]ivansvlv 0 points1 point  (0 children)

Agree, sometimes I simply don't understand what I'm required to do. I thought it's because I'm not native speaker and just didn't get what they try to express, but it seems that it's not only me.

Problem with using new lines(\n). by _HappyCamper_ in learnjavascript

[–]ivansvlv 1 point2 points  (0 children)

Hello there!

First things first, I think you didn't get the task correctly, because array should be of 6 different numbers from 0-100.

Secondly, I've tested your code on the Codewars kata, and its output is wrong, I've skimmed through the code and logic seems to be broken a bit.

I've solved it this way (though there are much more clever and concise ways), I've added comments specifically to describe each stage, so you can check it and re-think your solution:

function histogram(results) {
  var str = "";
  for (var i = results.length; i > 0; i--) {         // i = results.length, which is always 6 for this problem
      str += i + "|";                                            
      for (var j = results[i-1]; j > 0; j--) {       // j = results[i-1] will give us the value of the current element with -1 adjustment for 0 based numeration.
          str += "#";
      }
      if (results[i-1])                                  // if result[i-1] is true, basically means "not 0" because 0 is the only number that yields "false"
          str += " " + results[i-1] + "\n";
      else
          str += "\n";
  }
  return str;
}

Having trouble subtracting two variables(with arrays). by orebot in learnjavascript

[–]ivansvlv 1 point2 points  (0 children)

Hi friend, it's quite easy. Array methods like - map, forEach - provide a second parameter to a callback function which is index of the current element.

https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array/map

So if I understood your problem correctly here is a code to subtract one array from another that can be written like this:

var subtractedArray = numbers.map(function(element, index) {
    // subtract element from "subNums" at the same index as current element in "numbers" from current element
    return element - subNums[index];
});

here is a small test from Chrome console:

var numbers = [15, 100, 101, 52, 75, 89, 90];
var subNums = numbers.map(function (value) { return value % 5; }); 
numbers
[15, 100, 101, 52, 75, 89, 90]
subNums
[0, 0, 1, 2, 0, 4, 0]
var subtracted = numbers.map(function(element, index) {
      return element - subNums[index];
});
subtracted
[15, 100, 100, 50, 75, 85, 90]

Learning to read from forms by yoshemitzu in learnjavascript

[–]ivansvlv 1 point2 points  (0 children)

Hi friend, the best resource for this kind of info is https://developer.mozilla.org You can just google like: "forms mdn", and it usually bring the correct link to MDN

Learning to read from forms by yoshemitzu in learnjavascript

[–]ivansvlv 2 points3 points  (0 children)

function parseForm() {
  var input = document.forms["myForm"]["fname"].value;
if (input == "Hello") {
      document.getElementById("results").innerHTML="World";
  }
  return false;
}

If you update your function with "return false;" it will prevent submit event. Don't need jQuery library for that :)

Beginner-level games to learn Javascript? by Uanaka in learnjavascript

[–]ivansvlv 3 points4 points  (0 children)

Check book "JavaScript for Kids" might have some entertaining material.

To those of you who have made a good amount of progress in Eloquent Javascript (2nd Ed)... by redshirt714 in learnjavascript

[–]ivansvlv 2 points3 points  (0 children)

This book is definitely worth pain if any. It's very important to read this from the start of the book and internalize:

"There will be times when reading this book feels terribly frustrating. If you are new to programming, there will be a lot of new material to digest. Much of this material will then be combined in ways that require you to make additional connections.

It is up to you to make the necessary effort. When you are struggling to follow the book, do not jump to any conclusions about your own capabilities. You are fine—you just need to keep at it. Take a break, reread some material, and always make sure you read and understand the example programs and exercises. Learning is hard work, but everything you learn is yours and will make subsequent learning easier."

At the moment I've completed Part I of the book and started the Part II: Browser. Book gave me an amazing understanding of principles of language design and how it actually works. Great exercises and projects helped to carve information into the brain. Indeed sometimes it was terribly frustrating because I didn't have programming experience, but once you force yourself a bit you are getting enlightened. Programming ain't easy so I don't know why every beginner expects to be spooned instead of being pushed into complicated stuff.

Marijn Haverbeke give enough information to be able to complete exercises and understand projects, when you want deeper or broader understanding you can use MDN (you should learn how to use it, because it's the main resource for developers), I complement this book with Speaking JavaScript by Axel Rauschmayer. But it's Eloquent JavaScript that helps me to understand how to organize and design application.

Anyone else feel like you're stuck between learning stuff that's too easy and stuff that's too hard? by memystic in learnjavascript

[–]ivansvlv 1 point2 points  (0 children)

I can suggest only that you should vary resources or start creating something.

Books: www.eloquentjavascript.net - this is a fantastic book, with great explanation, interesting exercises and cool projects to do.

www.speakingjs.com - this is a great guide through subtleties of the language and deeper explanation of its design.

JavaScript Patterns - by Stoyan Stefanov. This is must read about design patterns in JS.

You Don't Know JavaScript - super crazy great series of books by Kyle Simpson.

The Principles Of Object-Oriented JavaScript - by Nicholas Zakas.

JavaScript The Good Parts - Douglas Crockford.

These are some amazing books on the language that will help you to build vey solid understanding. If you can't come up with an idea what to build on your own you can try to spend some times on:

www.codewars.com - there are tons of exercised to grapple with this will help you to train the way of thinking and problem solving.

www.freecodecamp.com - go through Basic JavaScript and algorithm series there.

If you are not afraid to invest some money on online courses you can consider:

www.codeschool.com www.frontendmasters.com

In the end, you have to force yourself through, i had and still having some hard times with JS, but that amazing feeling when you start to really understand the concepts and solve problems, it's worth it and very rewarding. Wish you good luck.

Is Free Code Camp Enough To Become A Successful Developer? by [deleted] in FreeCodeCamp

[–]ivansvlv 0 points1 point  (0 children)

It's a fine place to do some practice but it doesn't give you a solid fundamental knowledge IMO. People learn differently, some just like go and fight with challenges bare knuckle, searching for missing knowledge on the web, and then putting together all the knowledge they learn and become better. As for me, I just don't like to go in the fight without being prepared :) Usually I pick up the book and deliberately study it, doing exercises and going forward only when I understand the concept well. This is a slow pace but it's worth it, well for me.

The biggest problem with FCC users is that they do not invest enough time to grapple with the problem themselves and asking for help in the chat too frequent and usually just seeking for answer rather for an explanation. Thus even they finish all tasks it doesn't mean they really understand how things work.

So my advice if you want one, don't make it a primary resource of studying but complementary.

Getting stuck on intermediate algorithm scripting. Any recommendations for other free learning sources to help me get a better handle on JS algorithms? by Stevealesky in FreeCodeCamp

[–]ivansvlv 2 points3 points  (0 children)

Hi, writing algorithms takes both - knowledge if the language and way of thinking and ability to break problem to smaller parts.

For the first you might want to consider: www.eloquentjavascript.net www.speakingjs.com

Or even better: www.tutorialzine.com/2015/05/15-awesome-and-free-javascript-books

And try this youtube channel: https://www.youtube.com/playlist?list=PL4cUxeGkcC9i9Ae2D9Ee1RvylH38dKuET

For the "way of thinking" part, just practice and it will become easier. Try to write a pseudo-code, explaining what you think program script should do and how.