Business Category Archives - General Assembly Blog

Top Five JavaScript Interview Questions

By

JavaScript is one of the most popular programming languages. Even though there are many JavaScript-based frameworks like React.js and Node.js, the ability to answer some core JavaScript questions will always give you an upper hand during an interview.

So, let’s start!

1. What is hoisting?

Hoisting is a default process wherein JavaScript moves all the declarations to the top of the current scope.

Example:

a=20;
console.log(a) // 20
var a;

Even though variable a is initialized and accessed before it’s declared, JavaScript doesn’t throw an error.

2. What is the purpose of closures?

As per MDN Web Docs,

“Closure is the combination of a function bundled together (enclosed) with references to its surrounding state (the lexical environment).” 

In simple terms, Closure is what allows an inner function to access an outer function’s scope, even when the outer function has already returned.

Example:

const cartMode = function() {
    let items=[] // acts like a private variable
    function addItem(item) {
       items.push(item)
       return "Item added to Cart"
    }

    function totalItems() {
      return items.length
    }

    return {
       addItem,
       totalItems
    }

}

const cart=cartMode()
cart.addItem("Bag") // returns Item added to Cart
console.log(cart.items) // returns undefined
cart.totatItems() // returns 1

In the above example, the items variable is accessible to all the inner functions, but it’s not directly accessible from outside. This happens because of closures

3. What is the difference between let, const, var?

Before ES6, JS had no way to support block-level scope variables. Now, we have:

  • var for creating function-level scope variables.
  • let for creating dynamic block-level scope variables.
  • const for creating constant block-level scope variables.

Example:

var a = 20

if(a > 10) {
  let b = 1
  const a = 2

  console.log(b,a, 'Inner Scope')   // 1 2 Inner Scope
}

console.log(a, 'Outer Scope')   // 20 Outer Scope

4. What is the output of the following code?

console.log("1")
setTimeout(function(){
  console.log("2")
},0)
console.log("3")

Output:

"1"
"3"
"2"

Even though we specified the delay as 0ms, it still prints “2” after “3”. This is because of the Event Loop in JavaScript. 

In this case, first, console.log(“1”) is executed, then setTimeout() is executed; after the specified delay (in this case, 0ms), the callback function is added to Message Queue. Now the main thread only picks up items from the message queue once the current execution is done. So, the main thread first evaluates the console.log(“3”) statement post. Then, it picks up the callback() from the Queue and executes the console.log(“2”) statement. Hence, the above output.

5. Difference between arrow functions and regular functions?

Arrow functions are new ES6 syntax for defining functions. It looks like this:

const add = (a,b) => a+b
add(2,3) // 5 

The main difference between the arrow function and regular function is the value of this  keyword.

In case of arrow functions, the this keyword is assigned a value lexically. What this means is unlike regular functions, arrow functions never create their own execution context. They, by default, take the execution context of the enclosing function a.k.a., parent. 

Here is another great article explaining this in-depth. 

Conclusion

Preparing for JavaScript Interviews can feel overwhelming, but the only way to overcome them is to take one concept at a time

Explore Coding Workshops

How to Go From Zero to Hero in JavaScript Fast

By

JavaScript (often shortened to JS) is a lightweight, interpreted, object-oriented language with first-class functions — it is best known as the scripting language for webpages. It is a prototype-based, multi-paradigm scripting language that is dynamic, and it supports object-oriented, imperative, and functional programming styles.

Now, what does all that mean?

Well, it could be a bit overkill to try to explain those topics if you are just starting out in coding or learning JavaScript. In short, JavaScript most often correlates with client-side scripting on webpages. When you use a website, anything you interact with usually involves JavaScript — a search bar on Google or a dropdown menu on Facebook is all JavaScript.

While JavaScript was originally intended for websites, its uses have far surpassed front-end interactive website usage. JavaScript can be used as a server side-language with NodeJS to create desktop and mobile apps or program different electronics (popular YouTuber, Michael Reeves, uses JavaScript on a lot of his quirky inventions). JavaScript has expanded immensely since its inception with tons of different use cases and massive community support.

The Best Places to Learn JavaScript

There are many ways to learn JavaScript — here are some of the best and the most cost-effective ways.

1. Codecademy

Codecademy is a code-learning site that has multiple languages available with interactive and applicable examples. No downloads are necessary; it’s all in your browser! Best of all, it has a lot of free material.

I cannot stress how well Codecademy structures its learning process. I truly believe it gives a strong foundation and teaches you a lot of the basics that you need to get started with JavaScript.

However, just as with any coding language, it can be a little dry and tedious at first. Nonetheless, stick it out and work through the “Learn JavaScript” course:  https://www.codecademy.com/learn/introduction-to-javascript.

At the very least, work up t0 the “Browser Compatibility and Transpilation” section, but by all means, finish the entire course if you are up for it. 

2. freeCodeCamp

freeCodeCamp is very similar to Codecademy in the sense that everything runs in your browser. It has a code editor, console, and example browser window all within site. freeCodeCamp can seem daunting at first due to the sheer amount of content it has, but do not worry. If you are looking to learn JavaScript fast, it has a section called “JavaScript Algorithms and Data Structures Certification” specifically for JavaScript. It will take you through learning the basics of JavaScript and even some in-depth topics such as Data Structures and Algorithms.

Everything else freeCodeCamp has to offer is related to website programming. It even has sections on job hunting. If that is something you are interested in, I would recommend the entire site as it has a lot of great content. FCC also has a Youtube channel: youtube.com/c/freeCodeCamp, where it explains a lot of site topics in a video format.

3. Udemy/Youtube

I put these two in the same category since there is a lot of overlap, and you will see that a lot of people on Udemy use Youtube almost like a marketing tool for their full course. Nonetheless, a lot of Udemy courses range from $10–15 with a lot of good material. Really, one or two courses should be enough to learn JavaScript, so there is no need to spend a fortune. A few instructors I liked were Colt Steele and Brad Traversy.

Alternatively, both Colt Steele and Brad Traversy have Youtube channels that are free and have great content for learning JavaScript. Once you get the hang of the basics, I also recommend The Coding Train, which is run by Daniel Shiffman. I enjoyed all of these instructors’ teaching styles — they have great explanations for different concepts. That said, choose someone who best fits your needs and makes things clearest for you

How to Learn JavaScript Fast

As with any language, learning JavaScript requires time, studying, and practice. I recommend you learn the basics, which include:

  • Variables
  • Types of Data:  Strings, Integers, Objects, Arrays, Boolean, null, and undefined
  • Object Prototypes
  • Loops
  • If Statements/Conditionals
  • Functions

After you have those basics down, hop into some code challenges to get some practice. One site I would recommend is codewars.com. It has tons of challenges with varying levels of difficulty. Start at a basic level. Practice until you are comfortable with the above topics.

Another good practice exercise is making a game like tic-tac-toe or a basic calculator. With these exercises, you will be able to tackle different obstacles and exercise the syntax of JavaScript.

JavaScript Quick Tutorial

Variable Declaration

If the above materials are not enough, here is my quick JavaScript tutorial: 

First, we have variables. In JavaScript, there are three ways you can declare a variable:

  • var: function-scoped.
  • let: block-scoped.
  • const: block-scoped, but cannot be reassigned; it also is initialized with an “a” value, unlike “var” and “let.”

Data Types

There are different data types, as mentioned above, but the most important is Objects. Objects are used for various data structures in JavaScript such as Array, Map, Set, WeakMap, WeakSet, Date, and almost everything made with a new keyword.

A small note about null: If you were to check the data type of null through JavaScript, it would evaluate to an Object. This is a loophole that has been utilized by programmers for years. This might not be very common for you early on…

Comments

Comments in JavaScript are signified with “//” for single-line comments or “/* ….. */” for longer blocks of comments. I bring this up now since the examples below have comments.

Loops

If you are not new to programming, I am sure you know what loops are. For those of you who are new to coding, loops are used to iterate or repeat a block of code a certain amount of times or until a condition is met. Loops are often used to go through items in an Array.

The most common loops are the traditional for loops and while loops. A lot of the following is from the developer.mozilla.org and MDN, which is similar to the documentation for JavaScript — here are some of the different loops JavaScript has to offer:

for loop:

for ([initialExpression]; [conditionExpression]; [incrementExpression]) {

  // statement

}

Provided by MDN:

When a for loop executes, the following occurs:

  1. The initializing expression, initialExpression, if any, is executed. This expression usually initializes one or more loop counters, but the syntax allows an expression of any degree of complexity. This expression can also declare variables.
  2. The conditionExpression expression is evaluated. If the value of conditionExpression is true, the loop statement executes. If the value of the condition is false, the for loop terminates. (If the condition expression is omitted entirely, the condition is assumed to be true.)
  3. The statement executes. To execute multiple statements, use a block statement ({ … }) to group those statements.
  4. If present, the update expression incrementExpression is executed.
  5. Control returns to Step 2.

An actual code example of a for loop:

for (let i = 0; i < array.length; i++) {

 // code here

}

For loops are extremely useful and used often. It is very important to understand and master how for loops work. 

do…while loop:

A do…while loop will run code until a condition is false

do {

  // statement

}

while (condition);

while loop:

A while loop is very similar to the do while loop, but the key difference lies when the conditional is checked. In a do…while loop, the code block runs, and the condition is checked after the while loop checks the condition and runs the block of code.

while (condition) {

  // statement

}

for…in loop:

For…in loop is used to loop over objects

for (variable in object) {

  // statement

}

for…of loop:

For…of loop is used typically for arrays or iterable objects. I must stress using the correct loops for arrays and objects to avoid confusion.

for (variable of array) {

  // statement

}

If Statements

If statements depend on whether a given condition is true and perform what is in the first set of the code block. Do not continue to evaluate the subsequent “else” portions. If there are subsequent conditions that need to be checked, the use of “if else” will be needed. If all conditions do not evaluate as true and there is an “else” provided, the “else” portion of the statement will be used. 

if (condition) {

   // statement1

} else if (condition2) {

   // statement2

} else {

   // statement3

}

Functions

There are two ways to write a function: a function declaration and a function expression. The “return” keyword is used in JavaScript to define what a function will return. All subsequent code below a return statement will not run inside a function.

Function Declaration:

function square(number) {

  return number * number;

}

Function Expression:

var square = function(number) {

  return number * number;

}

The key difference between the two is the function declarations load before any code is executed, while function expressions load only when the interpreter reaches that line of code.

Object Prototype/Classes

In order to provide inheritance, JavaScript utilizes things called prototypes.

Here is an example of what the syntax would look like:

function Person(first, last, age, gender, interests) {

  // property and method definitions

  this.name = {

    'first': first,

    'last' : last

  };

  this.age = age;

  this.gender = gender;

  //...see link in summary above for full definition

}

Creating a new instance of that prototype would look like this:

let person1 = new Person('Bob', 'Smith', 32, 'male', ['music', 'skiing']);

If you come from a different coding language, you may be more familiar with the term “classes.”

JavaScript also has something called classes — classes are built on prototypes:

class Person {

  constructor(first, last, age, gender, interests) {

    this.name = {

      first,

      last

    };

    this.age = age;

    this.gender = gender;

    this.interests = interests;

  }

}

How To Run JavaScript

Since JavaScript is one of the core technologies of the Internet, every modern web browser will have built-in JavaScript consoles. There are also many web-based JavaScript compilers and interpreters.

Browsers

All the big-name browsers such as Chrome, Firefox, Safari, Internet Explorer, and Opera will have JavaScript consoles. I will explain the process on Google Chrome, but all the other browsers can be found in a similar fashion.

In Chrome, right-click anywhere in your browser window and select “Inspect.” Then click on the console tab. From there, you can write “JavaScript” right into the console. Another keyboard shortcut can be found by pressing Command + Shift + J on Mac and Control + Shift + J on Windows.

Web-Based

There are a lot of different web-based JavaScript consoles. My personal favorite is Repl.it, but other options include JS Bin, JSFiddle, and CodePen. Of course, if you find one that you are more comfortable with, you are welcome to use it. 

Can I teach myself JavaScript?

The short answer is yes. I do truly believe you can learn JavaScript on your own, but as with anything, it will take time and discipline. There may be times when you want to quit, think you’ve had enough, or question if you are doing it correctly. My answer to those questions would be to follow the free options of Codecademy and freeCodeCamp (above) as they are very structured and give a good foundation for learning. Never get discouraged; you will be surprised at how much you actually know!

So… should I learn JavaScript or Python?

This is a loaded question and could be a whole article in itself, but it really comes down to use cases. Almost everything outside of the coding languages of JavaScript and Python is alike. This includes popularity, support, community, free and paid courses, and versatile uses.

I mention use cases because if you intend to do web-based programming, you will most likely need to know JavaScript; if you focus on web programming, I would recommend learning JavaScript.

If you are more interested in data analytics, artificial intelligence, and machine learning, Python may be the route to go. This is not to say you can only learn one language. If you are up for it, learn both! Python and JavaScript have evolved a lot since they were created, and both can be used for websites, data analytics, artificial intelligence, and machine learning.

Explore Coding Workshops

How to Easily Run JavaScript in Terminal

By

TL;DR

You can run JavaScript in terminal or any command-line interface using Node.js, an open-source, platform-agnostic runtime that executes JavaScript outside a browser.

Before we take a deep dive into how to run JavaScript in your terminal, we need to understand few basic terminologies like:

  1. Client-Side JavaScript 
  2. Server-Side JavaScript
  3. Command Line Interface

Client-Side JavaScript

  • JavaScript code executed in the browser is known as client-side JavaScript. 
  • Client-side JS was originally used to add some interactivity on websites; for example, the Click on Submit button in a form sends form details to the server.
  • The <script> tag within your HTML page is used to write client-side JavScript, which is later executed by the browser.
<script>
  console.log("Client-side JavaScript");
</script>

Server-Side JavaScript

  • When you run JavaScript code outside the browser-like on a web server, it becomes server-side JavaScript.
  • Server-side JS is generally used to write the back-end logic of your application; for instance, you can check to see if a user password matches the stored DB password.
  • You can run Server-side JavaScript using any command-line interface.

But, what is Command Line Interface, a.k.a.,Terminal?

  • CLI is a text-based interface that allows users to perform some operation in a computer by typing commands.
  • The most common CLI for popular OS’s are:
    • Windows: Command Prompt, PowerShell
    • Mac: Terminal, iTerm

Let’s see how to run JavaScript in these popular CLI’s:

Running JavaScript in Terminal 

Executing JavaScript in Terminal has two steps:

  1. Installing Node.js.
  2. Accessing Node.js in Terminal/Command Prompt.
  3. Running your file using node.

Installing Node.js

  1. Go to https://nodejs.org/en/download/; you should see a page like below:
  1. If you are using Windows OS, click on Windows Installer or else click on Mac Installer for macOS.
  2. Once downloaded, double-click on the installer to install Node.js.

Checking Node.js in Your Terminal/Command Prompt

To open your terminal in macOS:

  1. Open the Spotlight Search Bar (Cmd+Space bar).
  2. Type Terminal: it has an icon like below — open it.
  3. Once opened, type the following command:
node -v

If you see an output like this, v14.15.3 Node.js is installed successfully.

Writing Your JS Code

  1. Create a new file called index.js in your Desktop/folder
  2. Let’s write some code!
const greet = (name=”Everyone”) => {    console.log(`Hello ${name}`);}
greet();

Now, let’s run it!

Running JavaScript in Your Terminal/Command Prompt

  1. Go to “Desktop path” within your Terminal/Command-Prompt:
cd /Users/arwalokhandwala/Desktop/
  1. To run your file using Node.js, type:
node index.js
  1. If you see an output like below, then Congratulations! You are successfully running your JavaScript in your Terminal/Command-Prompt:
Hello Everyone

Passing Runtime Arguments in Node.js

Like in the browser, we use forms to pass custom values to our JavaScript. If you wish to pass runtime values, then you can use process.argv[2]

const greet = (name = "Everyone") => {
   console.log(`Hello ${name}`);
}
greet(process.argv[2]);

In your Terminal/Command-prompt, type:

node index.js ArwaHello Arwa

Conclusion

Node.js makes it very simple to run JavaScript code in your Terminal/Command-prompt and opens a door of opportunities for a web developer.

Explore Coding Workshops

What Makes JavaScript So Popular

By

Our lives today are dependent on the interactivity that JavaScript provides. If you want to really see how much you depend on it, you can disable JavaScript in your browser for a day. Some pages will load quicker, they’ll be cleaner, you’ll have less ads, no pop-ups, and the battery life of your computer may last longer. But also parts of the webpages simply will not work. Neither will Netflix, YouTube, Google Docs, Google Maps, and much more. We are, to a good degree, dependent on JavaScript to function. Today, virtually every computing device including iPhones, Android phones, MacOS, Windows, Linux, smart TVs, etc.. in the world have JavaScript interpreters installed on them and in active use.

There are over 1.8 Billion websites in the world, and JavaScript is used on 95% of them

The popularity of JavaScript over the years.

JavaScript is by far the most used language according to Github’s 2020 Octoverse Report.

So how did JavaScript get this big? Why did it get so popular? 

The creation story of JavaScript is the foundation of its popularity. 

It begins in the year 1995 at the Netscape headquarters, where young Brendan Eich goes into a ten day sprint of coding and comes out on the other side with a new language. Wow!

As more people used browsers to use and experience the internet, there was a need for a programming language that would give life to the browser. Something that went beyond HTML and CSS. That’s where JavaScript came in to give life to the browser. It’s a language that is capable of doing what all other programming languages do but also has a special relationship with the browser. It changed the way we thought about the internet and ushered a new era of browser based applications. 

Easy setup 

Unlike many other languages, where you need to go download the language in your machine in order to access all of its features and create a development environment, with JavaScript anyone with a web browser suddenly has a development environment right in front of them. Every browser supports JavaScript!  


You can simply open your browser, like Chrome, and navigate to Developer Tools, and start coding away! To write a “Hello World” program is as simple as: 

console.log(“Hello World”); 

You can also use an Integrated development environment (IDE) or code editor like Visual Studio Code where you can create a file with the file extension .js to write JavaScript. Visual Studio Code (VS Code) is more widely used to write code but there are other editors like Atom and Sublime Text which are quite common amongst developers.  

Event-based programming
One of the most impressive features of JavaScript is that it includes event-based programming. It has built-in events like ‘onClick’ and ‘onHover’ that wait for user interaction on a website before executing a specific segment of code. For instance, when you click the night-mode toggle, that is an event which triggers a JavaScript code segment that changes the CSS across the whole website from light colors to dark colors. 

JavaScript can be used to generate dynamic contents on a website as well. Different HTML tags can be generated based on user input. For instance, if you are on Facebook and you click into a comment box to type your comment on someone’s post, in that moment your click was an event that executed a code block in JavaScript that led to the generation of an HTML tag to display your comment.

End-to-end programming with Node.JS 

While JavaScript has been given the title of The Language of the Browser, in 2009 with the release of Node.JS, a runtime environment that runs JavaScript code outside a web browser changed the fate of the language. Node.JS lets developers use JavaScript to write server-side scripting. Consequently, JavaScript’s popularity was dramatically increased because Node.JS represents the idea of “JavaScript everywhere” paradigm, unifying all of web application development around a single programming language, rather having a different language for server-side and client-side scripts. 

In other words, now developers can use one single programming language to talk to databases, make HTTP requests, generate dynamic content, and create interactive user experiences/interfaces. This led to the Rise of Web Applications that we are experiencing today. In addition to having a unified web-application development, JavaScript also became the go-to language for many companies because now the engineering teams only had to worry about a single programming language which made it easier to debug and save costs in the overall development process. 

In 2013 AirBnb launched their site and became the first to utilize the full-stack JavaScript solution. This approach allowed for code to be executed on the server-side and rendered in the browser with subsequent actions being handled by the exact same code on the client side. This inspired several other companies to do the same and today we have products and services like LinkedIn, Netflix, Uber, PayPal, eBay, Groupon, GoDaddy, CitiBank and many more using Node.JS. 

JavaScript Libraries and Frameworks

The popularity of JavaScript led to the creation of several libraries and frameworks that have made application development efficient and performant. Today, libraries like React JS, jQuery, D3.js, etc.. are used in most applications across the world. Frameworks such as Angular, Ember JS, and Vue JS provide optimal performance and organization to build large applications. 

Active Community 

Amongst the programming languages, JavaScript has one of the largest communities according to Stackoverflow. In addition to that community, Node.JS has over a billion downloads across the world and is one the most widely used technologies. 

These are just a few of the reasons why JavaScript is so popular. With the change in paradigm that led to the rise of web applications, unifying the web application development, cross browser support, and the plethora of libraries/frameworks available, the world of the internet has been fully invested in the growth of JavaScript. Furthermore, since JavaScript is a high-level interpreted language that is easy to understand, it is the one of the best languages to learn if you want to enter the world of programming and explore the amazing possibilities of web-application development. 

Explore Coding Workshops

What is the power of JavaScript used for?

By

At a high level, JavaScript is a scripting or programming language that allows you to implement complex features on web pages such as displaying timely content updates, interactive maps, animations, etc. JavaScript is used for all web-related software development. It is the most widely used and popular programming language in the world for website building.

The power of JavaScript is in its popularity, ease of use, and large community. It is one of the three core technologies of the World Wide Web (www), alongside HTML and CSS. Perhaps the most powerful thing about JavaScript is that it includes all of the features of a programming language embedded in your browser. Unlike other programming languages, where you have to download the language in your machine and create an environment, JavaScript does not require that. If you have a web browser like Chrome, then you can write JavaScript.

Originally, JavaScript was only on the client side of programming to create user interfaces and webpages’ interactivity. With the development of Node.js, JavaScript is not used in both client-side and server-side programming. This makes it extremely versatile and valuable.

JavaScript is the standard programming language of the web, and everybody uses the software written in JavaScript. Virtually everyone who has an internet-connected device with a screen can use applications written in JavaScript.

Popular Uses of JavaScript

Adding Interactive behavior to web pages: 

  • Show or hide information on a click event. 
  • Change colors of a button when the mouse hovers over it.
  • Slide through a carousel of images. 
  • Zooming in and out on an image.
  • Display a timer or a countdown on websites. 
  • Play audio. 
  • Embed video. 
  • Display animations and visual effects.
  • Creating pop-ups and modals 
  • Using a dropdown hamburger menu 
  • Client-side form validation.
  • Autocompletion.

Creating web and mobile applications:

  • Developers have access to a plethora of JavaScript frameworks for developing and building web and mobile apps. JavaScript frameworks are collections of JavaScript code libraries that provide developers with pre-written code to use for routine programming tasks. 
  • Popular front-end JavaScript frameworks include React, React Native, Angular, Vue, and Ember.js. 

Building web servers and developing server applications:

  • Node.js is a JavaScript runtime environment that allows developers to write server-side JavaScript to build servers and connect with databases. Frameworks like Express.js allow developers to build robust servers and develop back-end infrastructure using Node.js

JavaScript is the backbone of modern web applications, but much like the human spine, it is quite flexible and liberal in what it allows. This can sometimes be seen as a disadvantage because it makes finding problems in programs harder. But this flexibility allows developers to use many techniques that are not possible in more rigid programming languages.

A superpower of JavaScript is that it is easy to learn. It is widespread and supported by all browsers. Because it is a high-level language, it takes care of a lot of nitty-gritty programming for you, whereas in other low-level languages, you have to think about memory management, etc. In addition to being easy to learn, it is also easy to use. As long as you have a browser, you can write JavaScript to create rich web content.

Every programming language has some feature that separates it from other languages. In addition to all the amazing features of JavaScript, the one that stands out is how functions work in the language.

“Functions are the very best part of JavaScript. It’s where most of the power and the beauty of this language is.” — Douglas Crockford

Functions in JavaScript can be seen as workhorses. They alone play roles that other languages fulfill with multiple distinct features like procedures, methods, constructors, classes, and modules. All of these can be covered by the versatility of functions in JavaScript.

Finally, the most powerful feature of JavaScript is its community. It has one of the largest communities for any programming language. It is consistently ranked highest in Stackoverflow, Google searches, and GitHub issues. The amount of support for beginners is amazing!

Explore Coding Workshops

JavaScript Will Continue To Be Important

By

JavaScript is the ubiquitous scripting language of the web. Throughout its lifetime, it has had more than a few competitors, like JScript developed by Microsoft in the late Nineties and WebAssembly that has been around since 2019 (designed by W3C), but over time JavaScript has unified the way web sites are built and how browsers run. It has brought life and functionality to pure HTML and CSS static web pages by making them interactive. Currently, over 90% of all websites have some JavaScript running them. More importantly, over the last decade, JavaScript has jumped out of the browser and into other realms of application development such as back-end development, mobile development, and even machine learning. In recent times libraries and frameworks built on top of JavaScript have also been gaining popularity; in some cases, we are seeing JavaScript taking a backseat and running “under the hood.” Along with a worldwide community that maintains and develops JavaScript and its surrounding ecosystem, it seems evident that JavaScript has established its importance and is here to stay.

An Exploration of JavaScript & Its Importance

Why will JavaScript continue to be important? 

To best explore this statement, we will need to look at JavaScript holistically and highlight the programming language’s important aspects:

  1. We need to understand how JavaScript became the language it is to explore its background and history.
  2. We will need to understand where JavaScript stands performance-wise and how it compares to other scripting languages and competitors.
  3. We will look at where JavaScript is currently and the ecosystem that has been built around it.
  4. We will look at (or at least speculate) where the language is going and try to understand why it will continue to be as important.

Let’s dive in! 

Background & History

Developed internally at Netscape in 1994 by Brendan Eich and first released in 1995, JavaScript was not initially as popular as it is today. In fact, it was considered a somewhat messy and hard-to-manage language.

Here is JavaScript: The Definitive Guide v.s JavaScript: The Good Parts compared in size.

But over the years, JavaScript has become the ubiquitous programming language of the World Wide Web. Not to be confused with Java, which was the most popular programming language in the 90s when JavaScript was developed. Initially named LiveScript, and then changed to JavaScript, this caused some confusion and was later believed to be a marketing ploy by Netscape..

JavaScript was the programming language that brought life to previously static web pages by making them interactive. As its name suggests, JavaScript is a scripting language which are programs that can interact with HTML and CSS and make them do certain things – for example, when you click a submit button on a credit card input, JavaScript is there to make sure the servers receive that information and let you know what is going on with your request by changing the way the website looks. Every browser has its own JavaScript engine. There are many different engines:

  • V8: used by Chrome and Brave.
  • SpiderMonkey: used by Mozilla.
  • Chakra: used by Microsoft Edge.

Inherently, all JavaScript engines work similarly to each other with only slight differences. At their core, they compile the JavaScript code run by websites into byte code which our computer’s hardware can then interpret. 

Current Ubiquity: Inside & Outside the Browser 

In the last 10 years, JavaScript has been ubiquitous in web development because browsers use it. But in 2009, it jumped out of the browser and into the back-end with the release of node.js. By taking the Google V8 engine, developer Ryan Dahl introduced to the world JavaScript and its new ability to run servers. With the release of node.js, JavaScript allowed developers who worked purely in the client-facing parts of web development to have skills previously reserved for back-end developers. This would, over the next decade, be a huge pillar in JavaScript’s already established importance.

And not only that, within the past decade, we have seen JavaScript move into other parts of the application development ecosystems as well:

  • Back-End
    • Node.js
    • Express
    • NestJS
  • Mobile
    • ReactNative
    • NativeScript
    • Ionic
  • Machine Learning
    • TensorFlow
    • Brain.js
    • Webdnn
  • Blockchain
    • Truffle.js
    • web3.js

In a short time, JavaScript has become omnipresent in the world of application development. And the most interesting part is that so many frameworks are being built on top of JavaScript that we might not even be writing pure JavaScript one day. We see that companies are giving preference to building their applications with JavaScript frameworks like React and Typescript that allow you to develop apps without writing pure JavaScript.

JavaScript searches on Google over 5 years:

TypeScript searches on Google over 5 years:

Performance

Performance-wise, depending on the benchmark and environment, JavaScript can compete with most programming languages. In addition to that, the answer to JavaScript performance lies in the engines. In addition to precompilation abilities, there are optimizations such as just-in-time compilation that allow the engines to do less work. On top of that, each browser has its own engine developed by different tech companies; this creates an interesting competition environment. Therefore companies are trying to best one another at making their engine better than the other, which translates to better performance over a shorter period of time. 

Here are some benchmarks that ran with some simple computations, and we see that the JavaScript V8 engine is, in fact, able to compute faster than most. 

Future

With a bright future ahead, JavaScript is currently one of the most-used programming languages and a high-demand computer software industry skill. Some of the biggest tech companies are developing and maintaining JavaScript libraries, engines, and frameworks.:

  • Google
    • V8 Engine
    • AngularJS 
    • Chromium
  • Facebook
    • React.js
    • ReactNative
  • Microsoft
    • Chakra Engine
    • Typescript
  • Mozilla
    • SpiderMonkey Engine

JavaScript is baked into these companies’ core products, so we can say with certainty that while they’re around, JavaScript will also be there..

Explore Coding Workshops

What is a JavaScript library?

By

JavaScript is one of the most widely used programming languages in the world. It’s a scripting language used by developers to create interactive user interfaces that display dynamic content. It is given the title of The Language of the Web Browser because it is the most commonly used language to build web applications and works well across all web browsers

As the popularity of JavaScript increased and more people were using it to build websites and applications, the JavaScript community recognized that certain patterns in the code were being used repeatedly to accomplish the same tasks. This re-writing of code and recognizing that certain JS functions need to be implemented multiple times led to the development of JavaScript libraries and frameworks. For instance, reoccurring animations, interactive forms that appear in different places on a website or app, etc.. were repetitive tasks that could automate by having a code snippet utilized as needed without writing code every time.

Generally speaking, JavaScript libraries are collections of prewritten code snippets that can be used and reused to perform common JavaScript functions. A particular JavaScript library code can be plugged into the rest of your project’s code on an as-needed basis. This led to faster development and fewer vulnerabilities to have errors.

jQuery 

There are a plethora of libraries and frameworks available to JavaScript developers today, but the concept of a JavaScript library was initiated with the creation of jQuery. jQuery is a JavaScript library designed to simplify HTML DOM (Data Object Model) manipulation and event handling, CSS animations, and Ajax. At the time, jQuery shortened the syntax and simplified the code, making it easy to understand and increased developer productivity. 

All a developer had to do was install jQuery and use prewritten code snippets to manipulate the DOM. For example, if a developer wants to add an autocomplete feature in a search bar on their site, they would insert the appropriate jQuery code snippet into the project’s code. When a user enters text into the search bar, the jQuery code snippet retrieves the feature from the jQuery library and displays it in the user’s web browser. 

React JS

In 2011, Facebook created a JavaScript library called React, which specializes in helping developers build user interfaces or UI’s. React is a component-based library that helps developers design simple views for each state of the application. React is also extremely smart in that it does a lot of heavy lifting in terms of efficiently updating and rendering the right components when there is a change in data or the state in the application. Today, React is the most popular JavaScript library, and companies use it all over the world like Uber, Airbnb, Facebook, Netflix, Instagram, Amazon, Twitter, and much more. 

The component-based library allows developers to avoid the pitfalls of rewriting code and dealing with complicated debugging. With React, you can reuse and recycle different components across the web application or other products. Components such as navigation bars, buttons, cards, forms, sections, etc., can all be reused like little building blocks that make the application. A library like React dramatically increases the development speed with fewer bugs and makes extremely performant applications. 

Library vs. Framework 

Perhaps one of the most common topics of discussion in the software community is the difference between a library and a framework. As we see above, jQuery and React are libraries with prewritten code snippets that we can use and reuse to build applications. So while JavaScript libraries are a specialized tool for on-demand use, JavaScript frameworks are a full toolset that helps shape and organize your website or application. In other words, libraries are about using what is needed for the task, while frameworks provide you with all the tools you could need even if you don’t particularly need all of them. 

Think of it like cooking some pasta. When using a JavaScript library, you simply grab the pot, pan, ingredients to make the pasta, and plates to serve. You only require only the things you need to make pasta. When thinking about a JavaScript framework, imagine an entire fully loaded kitchen. Another way to think about it can be that JavaScript libraries are like pieces of furniture that add style and function to an already constructed house. At the same time, frameworks are templates you can use to build the house itself. 
Examples of some JavaScript frameworks include Angular, Ember JS, and Vue JS. These are some of the most popular frameworks with large communities and support systems. Frameworks provide a structure to base your entire application around, and developers can safely work within the structure’s rules. The advantage of frameworks is the overall efficiency and organization. The disadvantage is that a developer has less freedom to work around the rules and conventions specific to a particular framework. Libraries, on the other hand, give developers more freedom to use different code and snippets but do not provide the type of structure and convention that comes with a framework.

Explore Coding Workshops

What is a JavaScript framework?

By

A JavaScript framework is a collection of JavaScript code libraries that provide developers with pre-written code for routine programming tasks. Frameworks are structures with a particular context and help you create web applications within that context. 

It is completely possible to build strong web applications without JavaScript frameworks, but frameworks provide a template that handles common programming patterns. Each time you have to build an application, you don’t need to write code for every single feature from scratch. Instead, you can build upon an existing feature set. 

JavaScript frameworks, like most other frameworks, provide some rules and guidelines. Using these rules and guidelines, any developer can make complex applications faster and more efficiently than if they decided to build from scratch. The rules and guidelines help shape and organize your website or web application too! For example, think about a potter’s wheel where you can build pots. The potter’s wheel is your framework; it has certain consistencies that you have to work with. The wheel rotates, and you can use that rotation to build pots of different shapes and sizes. You can build pots, plates, cups, bowls, or even cylindrical sculptures. But you can’t build a house with it; you need to find a different framework for that. 

Framework vs. Library 

A common topic of discussion in the software community is the difference between a framework and a library. In truth, experts have suggested that the line between them can be blurry, but it is useful to make the distinction — as a matter of conversation. While a framework is a full toolset that helps shape and organize your website or application, a library, on the other hand, is a collection of pre-written code snippets that are less about shaping your application and more about providing a use-as-needed library of features. 

Model View Controller (MVC) 

Modern JavaScript frameworks use a software design pattern called Model–View–Controller. It is commonly used for developing user interfaces that divide related programming logic into three interconnected elements. The model is the central component of the pattern as it is the application’s dynamic data structure. It manages the data of the application. The view consists of all the code that has to do with representing the application’s data — the code for the user interface. The controller is the interpreter. It accepts inputs and converts them into commands for the model or view. Frameworks are built around the MVC design pattern to provide structure and adaptability in software development. 

Popular JavaScript Frameworks 

JavaScript is one of the most popular and widely used programming languages globally and has more frameworks than any other language. Since JavaScript is used for both client-side and server-side code, there are many frameworks to work with. Some of the most popular frameworks include: 

 Front-End Frameworks

React

React.js is an efficient and flexible JavaScript library for building user interfaces created by Facebook. Technically, React is a library, but it is often discussed as a framework and is compared to other frameworks. React makes it easy to create interactive user interfaces because it has predictable code that is easy to debug. Furthermore, it provides a component system where blocks of code can be written once and reused repeatedly in different parts of the application or even other applications. 

Angular

AngularJS is a popular enterprise-level JavaScript framework used for developing large and complex business applications. It is an open-source framework created by Google and supported by both Google and Microsoft. 

Vue 

Vue.js is a progressive framework for building user interfaces. It is an up-and-coming framework that helps developers in integrating with other libraries and existing projects. It has an ecosystem of libraries that allow developers to create complex and solid single-page applications. 

Back-End Frameworks

Express 

Express.js is a flexible, minimalistic, lightweight, and well-supported framework for Node.js applications. It is likely the most popular framework for server-side Node.js applications. Express provides a wide range of HTTP utilities, as well as high-performance speed. It is great for developing simple applications that can handle multiple requests at the same time. 

Next.js

Next.js is a minimalistic framework that allows developers to create a server-side rendering and static web applications using React.js. It is one of the newer and hottest frameworks that takes pride in its ease of use. Many of the problems developers experience while building applications using React.js are solved using Next.js. It has many important features included “out of the box,” and makes development a breeze. 

In the current job market, the most popular framework/library is React.js. Since JavaScript has so many frameworks, it can sometimes be hard to decide which one to start learning. You could start with any framework, but if your goal is to get a job, you will have better odds if you learn React first. The same can be said for Express.js as a back-end framework as it is the most widely used and sought-after framework. 

JavaScript frameworks are more adaptable for designing web applications and make working with JavaScript easier and smoother. This is why they are so popular amongst developers. A variety of frameworks exist because they can be applied to solve different problems. When choosing a framework, carefully consider your project requirements before deciding to implement any particular JavaScript framework. In addition to all the unique technical features of JavaScript frameworks, each framework comes with its own learning curve, community engagement/support, documentation, and compatibility. 

Explore Coding Workshops

A Product Management Career Map Developed by GA’s Product Management Standards Board

By

Businesses have shifted from traditional ways of operating to truly becoming customer-centric digital organizations — and the global pandemic has accelerated this inevitable shift. Product managers, who sit at the nexus of customer needs, business strategy, and technology, play a critical part in building their companies’ digital fluency so organizations can evolve and transform their products to meet market and customer demands. 

That said, product management is often ill-defined as a function, especially in traditional companies, and business leaders and managers have a responsibility to precisely understand product management skills and careers to help these nascent leaders succeed and unlock their full potential. 

By developing and integrating product managers as strategic thinkers who help evolve organizations into being customer-centric, leaders and managers can tap into many benefits:

  1. Improved leadership pipeline and succession planning: Product managers are responsible for many things, but skills development strategies to level-up their subject matter expertise into leadership roles are not often clear. By connecting product management skills to a long-term and articulated career path, you can improve your leadership pipeline and increase career satisfaction for your product managers.
  2. Clear hiring objectives: Evaluating candidates against a documented set of skills can decrease bias and help recruiters make vital distinctions between hiring project managers, product managers, and product owners. 
  3. Increased product management talent pipeline: Creating consistency around what early-career professionals understand a product manager to be and what they must learn creates access to product management careers for people who don’t already have product managers in their networks.

We formed the Product Management Standards Board with a wide-ranging set of product management leaders across the consumer goods, technology, finance, and education sectors. We’ll channel our collective experience into increasing clarity of and access to product management skills and careers so that the next generation of product management talent can maximize their impact in organizations and the world.

We’ve crafted a career framework as a valuable tool for:

  • Product leaders who want to build capable, well-balanced teams.
  • Aspiring product managers who want to understand what skills they need to enter the field and help lead organizations.
  • Mid-career professionals who wish to understand their career options.
  • HR leaders who want to build transparent, consistent career pathways.

What Defines an Excellent Product Manager?

We drafted a career map that captures our collective thinking about what makes a product manager and the career paths and associated skills required for an employee to one day become a product leader.

Let’s break down each section of the framework and see how they’re used to guide
career progression. 

Associate Product Manager 

To begin a career in product management, individuals often move into associate product management roles from within or outside an organization with some existing understanding of the business, product, and/or customer base. While we firmly believe anyone can become a product manager starting at the associate level, we commonly see analysts, software engineers, designers, project managers, or product marketers moving into this role. In this stage of career development, product managers learn to use data to make decisions, influence without authority, and understand the balancing act of prioritization.

Product Manager

Product managers learn a mix of skills based on their particular product, area of responsibility, and expertise. Product managers in charge of a new product or feature may heavily focus on research and development. In contrast, product managers responsible for improving the quality and efficacy of an existing product or feature may focus more on data analysis to understand what drives an improved experience.

Squad leadership is critical to ensuring all people understand the goal they are working towards and what success will look like. Product managers at a large organization have the opportunity to either specialize in a single domain or can work with their managers to rotate ownership over product areas to develop a breadth of experience and skills.

Product managers at a startup will likely get to experience all of these skills in rapid rotation as their teams iterate quickly to identify product-market-fit and the right set of features for their product.

Senior Product Manager

The senior product manager level is where product managers start differentiating between becoming “craftmasters” in the individual contributor path or people managers on the leadership path. While craftmasters still need to provide inspiring team leadership to those working on the product, they often become particularly versed in a product domain, like product growth and analytics.

In contrast, a people manager in this role largely focuses on team management skills. Either way, this role is a critical step in someone’s career as it allows them an opportunity to practice developing and sharing a vision for a product with their team and working with more moving parts to guide people towards that vision. Understanding and prioritizing these moving parts become a key skill to develop at this level.

Additionally, the responsibilities to make decisions related to product growth also increase here. This level is a product manager’s opportunity to demonstrate an understanding of how business, market, and product intersect to inform the direction of the product and distinctly articulate how they expect that product to impact the company’s financials.

Director of Product

At this career point, directors of product are making a critical transition from manager to leader. They have to bring the threads of the product strategy and the product roadmap together and take ownership and responsibility for their decisions and impact. The Director of Product also starts to gain ownership of the cost side of their decisions – at some companies, this can extend as far as P&L ownership for project and product costs. They move into managing a portfolio of products and connecting the dots between how they work collectively for users and guide teams to work through complex problems to develop goals on a longer, future-driven timeline. 

VP or Head of Product 

Once an individual reaches this leadership level, they have mastered the key functional skills of product. They are now the pivotal connection point between the rest of the company’s leadership plans and the product team. They have to get beyond “product speak” and help connect the dots between technology, customers, and business goals with other leaders and employees across the business. There is a fair amount of time spent aligning resources and plans with other leaders to drive the strategy forward. As product leaders, they are also driving innovative thinking and are responsible for either the entirety of the product or a significant portfolio in terms of the company’s financials. 

A Few Notes

We’ve had many rich discussions while building out the career map and teased out some nuances listed below that may come to mind as you work your way through this framework.

What about a product owner?

While product owners play a critical function, we do not see this as being a distinct job title for someone. If you’re curious about the distinction and who might play a product ownership function in your teams, read Product Dave on Medium

What about the difference between startups and large organizations and everything in-between?

Product leaders at a large organization should consider rotating their product managers between a few different areas before moving them into more senior roles to build a range of skills sustainably. Product managers at a startup will likely get to experience all of these skills in rapid succession as their teams iterate quickly to identify product-market-fit and the right set of features for their product.

Does the framework change for “craftmaster” vs. “leadership” paths?

We have focused this framework more on the leadership path, but there is a continued path as an individual contributor, especially within larger organizations. Senior product managers, principals, and distinguished product management roles often see product managers tackle increasingly complex problems and mentor their colleagues on critical product skills while remaining in the “craftmaster” path.

Where do tangential functions fit in?

Some roles work closely with product managers to enable the full execution of products, but they are excluded on this map as they are adjacent to a product manager career path. A few of these functions include pricing analysts, product marketers, and product operations. 

What happens after VP of Product?

The next step after VP of Product is very dependent on the organization. Some VPs of Product already report to the CEO or a business unit owner, in which case, those roles would be the next step. In other organizations, a Chief Product Officer role exists and becomes the next step. Data from Emsi shows that there has been a 140% increase in CPO postings from Nov 2019 to Nov 2020; a clear reflection of organizations’ increasing awareness of the value of the role of product leadership in aligning customer needs, technology, and business strategy, and the increasing number of opportunities for advancement to the executive suite in this field.

Next Steps: Putting Words Into Action

We formed the Product Management Standards Board to increase clarity of and
access to skills and careers so the next generation of product management talent can maximize their global impact in organizations. Our career framework is a first step toward achieving this goal, but it’s only effective if followed by action.

To put this theory into action, we have started using this framework within our
organizations to:

  • Explain career progression and roles across our teams to guide development conversations and linking individual activities to strategic objectives on our product teams.
  • Guide high-potential employees on how to maximize their leadership skills.
  • Evaluate job candidates based on their skills match with the function for which they are applying, rather than exclusively what schools they’ve gone to or previous roles they’ve held. 

If you could benefit from these same actions, we encourage you to join us in using the framework for similar purposes in your organizations. Our industry needs to use a common language around product management, and that language extends beyond our board.

This is a living document, and we’ll be seeking feedback from partners in our executive teams, industry associations, and peers around the world. We’re also asking you. If you have feedback on how this could be useful for you, please let us know at cheers@ga.co.

By coalescing on what it takes to succeed in product management careers, we can begin to solve some of the pertinent talent challenges facing the profession and better prepare the next generation of leaders. We look forward to working to standardize product management career paths together.

8 Simple Ways to Turn Your Skills into a Profitable Side Business

By

8 ways side hustle robinson

In the US alone, there are over 28 million small businesses. Of those, an estimated 22 million consist of a single operating member—solopreneurs as I like to call them.

Many of these small business owners started their businesses as nothing more than the intersection of passion and skills that combined to create a business idea with the ability to earn extra money and scale into something truly sustainable.

As someone who’s successfully launched four profitable side businesses over the past four years, I’ve learned a lot about how to turn your skills into a healthy side income. From building physical products to selling my consultative services, and building my own suite of digital products, I’ve been able to generate thousands in extra income each month.

If you’re ready to build a foundation for one day becoming gainfully self-employed, here are my top eight ways to get started with a profitable side business today.

Continue reading