top of page
Search

JavaScript language lessons

  • Writer: Keshav Batra
    Keshav Batra
  • Jul 15, 2022
  • 2 min read

Ever since I've applied for a potential internship at F84 Studios, they have since gotten back to me and sent me a test using JavaScript. They told me that there was no time limit and for me to take all the time I need. So I've been watching this 3 hour video in bits and pieces and so far its been similar to C# but its also very different. Below is an example of all the notes I've jotted down as I watch the video.



var number =5; //in-line comment

/* this is a
multi-line comment*/

/* Data Types;
undefined, null, boolean, string, number, and object
*/

//A string is any sort of text
//Undefined is a variable that hasn't been set to anything yet
//Boolean means true or false
//A symbol is an immutable primative value that is unique
//An object can store a lot of key value pairs

var myName= "Kesh"; //One way to set a variable is to use the var keyword and it can be called anything

myName=4;

let ourName="BatraHousehold" //Let will only be used in the scope where its been declared

const pi=3.14; //Const is a variable that will never change and will always stay the same

var A; //This is declaring a variable

var B =3; //This is assigning a variable

console.log(A)

A=7; //a didnt have to be declared since its already declared

B=A; //The contents of a has been assigned to b

console.log(A) //Allows things from the console to be seen

var a = 9; //

//Variables that are uninitialized are always undefined

var A = 5;
var B = 10;
var C = "I am a string";

//Do not change code below this line

A=A+1; //5+1
B=B+5; //10+5
C=C+"String";

//Declarations
var studlyCapVar;
var properCamelCase;
var TitleCaseOver;

//Assignments
studlyCapVar=10;
properCamelCase="A String";
TitleCaseOver=9000;

//Adding

var sum=10+10;
console.log(sum) //shows that the answer is 20

//Subtraction

var difference = 45-33; //difference variable = 12

//Multiplication

var product = 8 * 10;

//Division

var quotient = 66 / 33;

//Incrementing Numbers

//Incrementing a number means to add 1 to it

var myVar = 87;

myVar=myVar+1; //87+1==88

myVar++; //The number has been incremented from 87 to 88 and can keep adding up

//Decrementing Numbers

//Decrementing a number means to subtract 1 from it

var myVar=11;

myVar=myVar-1; //11-1=10

myVar--; //Keeps subtacting

var ourDecimal=5.7;

var product= 2.0* 2.5;

console.log(product)

var remainder;

remainder = 11%3;

var a = 3;

var b = 17;

var c = 12;

a = a + 12;

b = 9 + b;

c= c + 7;

a += 12;

b += 9;

c += 7;


 
 
 

Commentaires


bottom of page