Functios Flashcards
set of instructions and are reusable, perform one action as a best practice.They form the building blocks of a program.
what is a function
set of instructions
variables
hold number, strings and data types at given time
why the variables are undefined?
if we didn’t put a value on it
difference between var and let
when you use let, a variable with the same name can only be declared once.
difference between let and const
Change the code so that all variables are declared using let or const. Use let when you want the variable to change, and const when you want the variable to remain constant.
++; h –;
+1 h -1;
a= a+=6 ; h shortcut a+=6;
otan prostheteis to proigoumeno
px a einai 5
string
a string can be surrounded by single or double quotes
+=
otan prostheteis kati me to proigoumeno
.length
epistrefei to mikos
javascript counting
begins from 0
In JavaScript, String values are immutable, which means that they cannot be altered once created.
you can always reassign a String
remove an item with pop function
.shift() removes the first item
.pop() removes the last element of an array