Tips and Tricks for WRITING JAVASCRIPT code

  • Tips and Tricks for WRITING JAVASCRIPT code : JavaScript always has to be written inside of the < script > tag, so that your browser knows you are switching from HTML to a new programming language. You can put < script > tags in the < head > or < body > of your page.

 

  • Just like HTML and CSS, JavaScript is written in a special way and has its own syntax. It is a case-sensitive language. You should leave spaces between pieces of code to make them easier to read.

  • Each instruction you give your browser in JavaScript is called a statement. Statements have to end in a semi-colon ; Curly braces {  } are used to group statements together into a block of code to be run in one go by your browser.

  • Statements normally start with a keyword that tells you the action the statement will perform.

  • You can store information in your browser using variables. Variables have a name and a value, which can be either text or numbers. If the value is text it has to be in double quotes ” “. If your variable name has two words, write it using camelCase.

  • To change or set the values of your variables you can use assignment operators, arithmetic operators and comparison operators.

  • If statements and else statements are known as conditional statements. Using conditional statements allows us to make our code do different things depending on the value of a variable.

Using JavaScript helps us make interactive web pages that respond to the user.


Related Links:

Online JavaScript Compiler. Code on the go.

Object-Oriented Programming (OOP)

Methods of teaching programming

JavaScript Glossary

Comparing Python to other languages

Introduction to JavaScript – Variables: Review

Learn Code Introspection Python Programming

Introduction to JavaScript – Variables: Undefined

My little pony learning game in VB.NET

FAQs

Introduction to JavaScript – Variables

Python Basic Operators

Introduction to JavaScript – Create a Variable: const

How to make a go-back button with PHP code?

Introduction to JavaScript – Control Flow: True and False values

Adding Python Comments

Introduction to JavaScript – Variables: Undefined

MORE CSS PROPERTIES

Using more than one CSS property

The color CSS property

Hello World Android app built with Android Studio

Alignment CSS properties

Introduction to JavaScript – Create a Variable: let

Connected through code, Choose Your Platform!

About the Author: Bernard Aybout

In the land of bytes and bits, a father of three sits, With a heart for tech and coding kits, in IT he never quits. At Magna's door, he took his stance, in Canada's wide expanse, At Karmax Heavy Stamping - Cosma's dance, he gave his career a chance. With a passion deep for teaching code, to the young minds he showed, The path where digital seeds are sowed, in critical thinking mode. But alas, not all was bright and fair, at Magna's lair, oh despair, Harassment, intimidation, a chilling air, made the workplace hard to bear. Management's maze and morale's dip, made our hero's spirit flip, In a demoralizing grip, his well-being began to slip. So he bid adieu to Magna's scene, from the division not so serene, Yet in tech, his interest keen, continues to inspire and convene.