Select Page

Learning Javascript

Welcome to javascript.  Since there are so many resources out there, I thought I would try and distill down what you really need to learn about each area into this blog.  Hopefully this will help you on your javascript blog, as I  am embarking on this journey after many years of waiting.

I am learning early on that learning another language before Javascript was very helpful.  But if this is your first language, you will be fine.  Go slow, learn each concept in great detail.  Then move on.  Don’t try and run before walking, and don’t try and be faster than someone else.  

1)   Javascript Types

Javascript Booleans and Equality

Booleans are true and false let Bob = 20; Bob === 19   //outputs FalseBob === 20  // outputs True NEVER USE ==  ALWAYS USE === Why? Triple === will check the value on the left and right are the same value and the same type "10" == 10  //  this will give me a True,...

Javascript Null and Undefined

let dog; console.log(dog); This produces undefined. Undefined comes when you try and access a variable that's been created but not set. Null is a value of nothing. Undefined is a value of a variable that has not yet been assigned a value. Examples: let...

Javascript Objects

Objects are used for collections of data and collections of functionality. Let's create an object called person. When you create an object you use curly brackets and you then define properties and values. const person = { first: 'Mike', last: 'Coleman', age: 100 };...

Javascript Numbers

Javascript numbers include integers and floats. You can concatenate numbers, even if they are enclosed in quotes, but using addition does not add the numbers. Example: a = 5 b = "7" / b is a string You can find the type of a variable by using this function: typeof(b)...

Javascript Strings

Javascript strings are very similar to python, with some differences. You can use single or double quotes, and you also can use backticks. Backticks are a great way to enclose strings that have both single and double quotes in them, as anything in a backtick is...

2)  Javascript Functions

Javascript Functions – Different ways to declare functions

/* First class citizen - what does this mean?  In javascript, functions can be passed into other functions functions can be stored in variables */ // Let's talk about putting functions into variables /*  Method 1: function doctorize(firstName) {...

Javascript Functions – Parameters and Arguments

function calc(billAmount, taxRate = .05) { /* In the above line: function = keyword calc = function name billAmount = a parameter taxRate = another paramter, with a default vale { = scope start  */ //This is the function body...

Javascript Custom Functions

// Functions are defined and called // This is a function definition: function calc() { //This is the function body console.log('Running Calculate!'); const total = 100 * 1.07;  //sales tax 7%, as an example return total; } //This is a function call...

Javascript Built in Functions

Example: Math.max is a built in function in javascript. Math.max(4, 10, 11, 15)    // returns 15, the highest of the numbers. 4,10,11,15 are called arguments.  Arguments are passed to a function. 15 is called the returned value console.log('Text')  // returned Text in...

Subscribe

Join My Newsletter