Notes for Javascript
Live Site Link (Credits Jonas Schmedtmann JS Course)
Navigate to the Topic
// Author: Chandraprakash Darji | |
// Github: https://github.com/Chandraprakash-Darji | |
// Question: Describe abstract class called Shape which has three subclasses say Triangle, Rectangle, Circle. | |
// Define one method area() in the abstract class and override this area() in these three subclasses to calculate for specific object i.e., area() of Triangle subclass should calculate area of triangle etc. | |
// Same for Rectangle and Circle | |
import java.util.Scanner; | |
public class Abs { | |
public static void main(String[] args) { |
"""Add a couple methods to our LinkedList class, | |
and use that to implement a Stack. | |
You have 4 functions below to fill in: | |
insert_first, delete_first, push, and pop. | |
Think about this while you're implementing: | |
why is it easier to add an "insert_first" | |
function than just use "append"?""" | |
class Element(object): |
"""The LinkedList code from before is provided below. | |
Add three functions to the LinkedList. | |
"get_position" returns the element at a certain position. | |
The "insert" function will add an element to a particular | |
spot in the list. | |
"delete" will delete the first element with that | |
particular value. | |
Then, use "Test Run" and "Submit" to run the test cases | |
at the bottom.""" |
"use strict"; | |
function palindrome(str) { | |
let pureStr = ""; | |
const letterNumber = /^[0-9a-zA-Z]+$/; | |
for (const letter of str) { | |
if (letter === " " || !letter.match(letterNumber)) continue; | |
else pureStr += letter.toLowerCase(); | |
} | |
let res = false; | |
for (let i = 0; i < pureStr.length / 2; i++) { |
Live Site Link (Credits Jonas Schmedtmann JS Course)
Navigate to the Topic
"use strict"; | |
const divideTheNumberInParts = function (number) { | |
const numberInList = []; | |
for (let i = 0; i < number.length; i++) { | |
numberInList.push(number[i]); | |
} | |
const numberInPattern = []; | |
for (let numberMark = 0; numberMark < numberInList.length; numberMark++) { | |
let tempNumber = ""; | |
let temp = 0; |