What is a script

and how to create one?

A script is a series of instructions that a computer can follow to achieve a specific goal, so a script could be compared to:

  • Recipes: By following the steps you can bake a cake.
  • Manuals: By following the instructions you can repair your car.

Basically a step-by-step guide to get something done.

To write a script you need to determine a specific goal and maybe even break it down in to smaller goals with specific steps each of them.

You can benefit from writing detailed scripts by keeping things organized and simplifying your code, avoiding repetition, and of course less code means less bugs.

Design a script

//greet you by name in the console

//declare a variable with your name
let name = "Johnny"

//declare a function that logs to the console
const helloSayer = name => console.log("hello " + name)

//call the function
helloSayer(name)

script in the