Skip to content

Instantly share code, notes, and snippets.

View AbudiMutamba's full-sized avatar
💭
Kyendi Kyendi

Abudi AbudiMutamba

💭
Kyendi Kyendi
View GitHub Profile
@AbudiMutamba
AbudiMutamba / DOM
Created July 9, 2021 09:54
Ablesolver cohort 1 JS session 5 DOM
/**
* DOM: short Document Object Model
* DOM is a W3C (World Wide Web) Consortium standard.
* It is broken into 3 catogeries. i.e: Core DOM, XML DOM and HTML DOM
* HTML DOM enables JavaScript to get, add, change/modify, remove element in HTML.
*/
// console.log(document.documentURI);
// console.log(document);
//DOM changes happen dynamically or on the fly and they're not persisted.
@AbudiMutamba
AbudiMutamba / Array methods 2
Created July 8, 2021 14:35
Ablestate Corhort 1 javascript session
/**
* array.pop()
* Removes the last element in the array and returns it.
* It's an example of a normal method because it doesn't take in parameters and it doesn't return a function
*/
// const ebikaByaBaganda = new Array(
// "Balangira",
// "Mamba",
// "Nyonyi Nyange",
@AbudiMutamba
AbudiMutamba / Array objects
Created July 7, 2021 10:22
Ablestate Corhort 1 javascript session
/**
* Array methods
*/
/**
* array.concat(value1, value2,...valueN)
* Concatinates two or more arrays and returns a new array
* It also accepts values of different data types e.g strings, numbers etc
*/
console.clear();
@AbudiMutamba
AbudiMutamba / string methods
Created July 6, 2021 10:40
Ablestate Corhort 1 javascript session
console.clear();
//console.log("test");
/**
* string.substr(start[, lenght]): Extracted a portion of a string beginning from start and ending at start plus length.
* The return is the extraction begins from the end of the string.
* If start is out of bounds or greater than the string.lenght an empty string will be returned.
* If you don't specify the lenght but specify the start then the return from the start to the end of the string.
* If you dont specify the beginning and end or if you don't specify arguments it returns the entire string.
*
*/
@AbudiMutamba
AbudiMutamba / Quiz 3
Last active August 1, 2021 12:47
Algorithm that validates a false value.
//There are only six falsey values in JavaScript: undefined, null, NaN, 0, "" (empty string), and false of course.
/**
* @fuction determineFalsy
* @param {value} input
* @returns false
*/
let determineFalsy = (input) => {
if (!input) return true
@AbudiMutamba
AbudiMutamba / Inbuilt JavaScript Functions part2
Created July 2, 2021 10:30
Ablestate Corhort 1 javascript session
/**
*String properties and methods continued
*/
/*
*string.length: Returns the number of characters in the string. They include alphabets, spaces, punctuation and everything that is included in the string.
*/
let exampleString = "Tugezesa strings mu JavaScript";
const obuwanvuBwaString = exampleString.length;
console.log(obuwanvuBwaString );
@AbudiMutamba
AbudiMutamba / quiz4
Created July 2, 2021 10:26
Code Explanation
//Using while
/**
* Quiz: Using comments describe what the functionbwlow does. Describe each line in the function
*Submit your answer before the end of the today
*@function REVERSE_STRING
*@param {string} string
*@loop - while
*@param {string} name
*@param {string} lastPosition
*@param {string} reversedString
@AbudiMutamba
AbudiMutamba / Inbuilt JavaScript Functions
Created July 1, 2021 09:27
Ablestate cohort1 -JS session 8
/**
* String Methods: They help us manipilste strings at work with strings.
*
* Methoda are the functions that are part of an object or class
* Properties/Attributes are the variables tha are part of the an object or class
* Example in JavaScript string objects have the charAt() method and the lenght property.
* To access methods and properties with the dot syntax
* ie.
* instance.method()
* instance.property
@AbudiMutamba
AbudiMutamba / callbacks.js
Created June 29, 2021 10:01
Ablestate cohort1 -JS session 6
/**
* Callbacks: Functions passed as arguments and are involked by the calling function( Function where they are passed)
*
*/
/**
*@Greet
*@param {string} msg - Greeting message
*@param {callback} returnName - Returns name
*@returns {string} - Greeting + name
@AbudiMutamba
AbudiMutamba / quiz 2 review
Created June 28, 2021 10:04
Ablestate cohort 1 JS online session 5
// Breakdown
// Create a function : function styles / expression/ decleration with the name mutiplyThreeNumbers
// Assign three indetifiers num1, num2, num3;
//Declare a variable multipliedNumbers and intialize
//Print to screen
/*
// PEMDAS
*parathesis
*Exponents(power)