Comparing Go with JavaScript

Let's explore the differences between JavaScript and Go languages.

Functions

In JavaScript:

// Function declaration
function explain() {}

// Functional expression
const explain = () => {};
Code snippet 1.1

In Go:

func explain() {}
Code snippet 1.2

Printing to console

In JavaScript:

console.log('Explaining...');
Code snippet 1.1

In Go:

fmt.Println("Explaining...")
Code snippet 1.2