Image for post
Image for post

When I realized not all countries get paid on Medium, I had to make my research and follow few steps (listed in this article). It works my friend! 😊

Bloggers need to be compensated for writing articles because I know how stressful it is.

Medium pays trending stories through Stripe but not all countries support certain features.


Image for post
Image for post

React happens to be the most popular JavaScript framework sourced from Stack Overflow Developer Survey (2020). It is the best alternative to two other popular JavaScript frameworks, Angular and Vue. They all allow you to create fast apps in the browser.

According to the official React website:

React is a JavaScript library for building user interfaces

In the definition above, the term user interface is also called a component to React.

A template-like component can be created for reuse in a single web app. It totally adheres to the Don’t Repeat Yourself (DRY) principle.

You only have to change the…


Image for post
Image for post

This article is sponsored by Hostgator — Get Started today for $0.99

alert

The alert function accepts a single argument. It displays the result on a modal dialog window.

The word modal means a user can’t interact with the rest of the page.

The modal dialog window is a small box displayed on a web page.

Syntax:

alert(arg);alert('Hello World!');

prompt

The prompt function accepts two arguments.

Syntax:

prompt(arg1[, arg2]);
  • arg1 is required.
  • arg2 is optional.

On Internet Explorer, arg2 is required.

// For other browsers
const birthYear = prompt("What year were you born?", 2021);
alert(birthYear);
// For Internet Explorer const yourName…

Image for post
Image for post

This article is pending… It Will be republished on the 01/21/2021

Techstack | Hostgator

Techstack article is sponsored by Hostgator.

  • A ton of website hosting options
  • 99.9% uptime guarantee
  • Free SSL certificate
  • Easy WordPress installs
  • A free domain for a year

Image for post
Image for post

To declare a variable in JavaScript either var, let or const is used.

Let’s see the differences between the three below.

Var Vs Let

Block Scoped

A Block scope contains a group of code within curly braces {}.

A variable created with the let keyword in a block scope is only available within it.

let greeting = "Hi John!!!"; // Global Variableif (true) {
let greeting = "Hello Bello!!!"; // Local Variable
console.log(greeting);// Hello Bello!!!
}
console.log(greeting) // "Hi John!!!"

let creates either a global or a local variable. …


Image for post
Image for post

This article is sponsored by Hostgator — Get Started today for $0.99.

Brendan Eich knew it would be impossible to create a programming language without mistakes in 10 days, so he created a multi-paradigm type of language, JavaScript.

Multi-paradigm is a term in computer programming that allows different styles of programming by developers. That is the ability to structure code in different ways.

The Multi-paradigm approach made JavaScript flexible and versatile. In fact, JavaScript at first was not created to last long, it was created to support Java to improve the users’ experience on the web.

Overtime, JavaScript began to…


Image for post
Image for post

Statements

Statements generally are instructions to be executed by a computer program.

A JavaScript Program or code is a list of programming statements

Statements in computer programming are executed from top to bottom (and left to right) in the order they appear.

console.log('Hello World!')

When there is more than one statement in a JavaScript program, it is recommended to end statements with a semi-colon.

console.log('Good Day!');
console.log('Happy Coding!');

Although without ending each statement with a semi-colon, computer programs will most likely execute successfully.

console.log('Good Day!')
console.log('Happy Coding!')

There are a few cases when ending statements without semi-colon can lead to errors.


Image for post
Image for post

JavaScript can display data in different ways using:

  • console.log()
  • alert()
  • document.write()
  • Using innerHTML

console.log()

As shown in the previous article, you can debug unexpected results from the browser in the console.

index.html

<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Using log Object</title>
</head>
<body> <script>
console.log('Hello World!')
</script>
</body>
</html>

Edit on Stackblitz

index.html

alert()

The alert() object is used to display data on the window browser. It displays the result in a modal dialog box.

<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=, initial-scale=">
<title>Using alert object</title>
</head>
<body> <script>
alert('Hello World!')
</script>
</body>
</html>


Image for post
Image for post

Internal JavaScript

HTML Document allows JavaScript programs to be inserted in a <script> tag. The <script> tag is placed just before the closing <body /> tag. This allows the HTML parser to load all HTML content first before loading the JavaScript program.


Errors in the browser are not visible to developers. But there’s one specific tool that developers use to debug Javascript errors called the console.

How to Open the Console

Image for post
Image for post
how to open a developer console

To open a ready-made developer environment or console, use either of the following keyboard short cut.

  • Ctrl + Shift + I (Chrome and Firefox)
  • F12 (Chrome and Firefox)
  • Ctrl + Shift + J for (Chrome)
  • Cmd + Opt + J for Mac (Chrome)
  • Ctrl + Shift + K (Firefox)
  • Cmd + Opt + K for Mac (Firefox)
  • Preference — Advanced — click the check box at the bottom (Show Developer menu in menu bar) — Cmd+ Opt+ C (Safari)

To insert multiple lines on the console, press Shift + Enter. And click Enter to execute the code.

Happy Coding!!!

Bello Noah

Hi, I am Bello Osagie, a web developer. I teach web development for free… so join me and have fun learning. Let’s code together!!! 😎

Get the Medium app

A button that says 'Download on the App Store', and if clicked it will lead you to the iOS App store
A button that says 'Get it on, Google Play', and if clicked it will lead you to the Google Play store