Tips and Tricks for WRITING JAVASCRIPT code

You are here: Home » Blog » Computer Programming Languages » JavaScript » Tips and Tricks for WRITING JAVASCRIPT code

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


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


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

About the Author:

I am a loving father, & husband. I am a computer enthusiast. I have used and enjoyed computers since I was young and I enjoy teaching young minds how to code, because it teaches them how to think. Today with YouTube, and social media garbage our youth are losing the ability to think on their own and solve problems. I believe this is a serious epidemic as kids today dont understand that technology is a tool. This tool is being abused, and its underlying effects are taking its toll on kids behaviour, and learning.