JavaScript is a Real Language

03 Sep 2020

Spring 2018 was my third semester as a computer science major. I had just finished two consecutive semesters of C++ programming. I knew just enough to get me by reading code. I had a rudimentary idea of the variables, data types, and simple conditional statements. I thought that C++ was super complicated, all the libraries and the precise syntax required made me hope I could get away from it. That’s when I took my first class using JavaScript.

I remember my first line of JavaScript code.


console.log(typeof 4.5) 

I still have the bookmark Eloquent JavaScript and that was the first example of using the console in the book. I followed every exercise and completed the class with a good grade. We used a variety of web design oriented libraries of JavaScript like jQuery and Node.js. I still did not know how useful JavaScript could be.

I had several more semesters, mostly a new language each semester. In school doing mostly web design and development, JavaScript was a language used to modify existing pieces of code from the libraries we wanted to use. It was limited to creating visual changes on websites, and light processing of functions. I did not have an appreciation for it as a “normal” programming language like C++ or Java.

In my software development class when the syllabus said that we were going to use JavaScript, I thought I was going to be making buttons, and graphics again rather than continuing with algorithms and problem-solving. Thankfully I was wrong.

In the first week of practicing with JavaScript, we had to determine if the elements in a string were repeated. No buttons, sliders, multivariable graphics, a “thinking” problem. The solution I found was 10 lines with a for loop and a conditional statement. During the lecture, he says there’s a way to do it in two lines. I wanted to know, and I found this,


function isUnique(str) { 

  return new Set(str).size == str.length; 

} 

I didn’t know how it worked or what all of it meant, but it worked, and I wanted to understand. I found the start of the next two days of reading on MDN web docs. I have found that JavaScript is not simply a web function language, but it has the functionality of C++ and Java that I am familiar with. But more importantly, all the years of learning and reading have made me better able to find my own answers and continue to understand more. Thank you to all the professors, teammates, and friends that have guided me thus far.