Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <!DOCTYPE html>
- <html>
- <head>
- <meta charset="utf-8">
- <meta name="viewport" content="width=device-width">
- <title>JS Bin</title>
- </head>
- <body>
- <script id="jsbin-javascript">
- //--------------------------------------------------
- //Name: Jesse Kosydor
- //--------------------------------------------------
- //--------------------------------------------------
- //Exercise: Property Path Evaluation
- //--------------------------------------------------
- /*let object = {
- }
- const propertyValueAt = (object, array) =>{
- }*/
- //--------------------------------------------------
- //Exercise: Sum Nested Arrays
- //--------------------------------------------------
- //--------------------------------------------------
- //Exercise: Word Count
- //--------------------------------------------------
- /*let wordCount = sentence => {
- str = sentence.split(" ");
- return str.length
- }
- console.log(wordCount("Hello World!"))*/
- //--------------------------------------------------
- //Exercise: Anagram Tester
- //--------------------------------------------------
- /*let areTheseAnagrams = (firstString, secondString) => {
- let areStringsEqual;
- let str1 = firstString.toLowerCase().split("").sort().join("");
- let str2 = secondString.toLowerCase().split("").sort().join("");
- str1.toLowerCase();
- str2.toLowerCase();
- console.log(str1)
- console.log(str2)
- if(str1 == str2){
- areStringsEqual = true;
- }else{
- areStringsEqual = false
- }
- return areStringsEqual
- }
- console.log(areTheseAnagrams("bad", "dba"));*/
- //--------------------------------------------------
- //Exercise: Analyze Prices
- //--------------------------------------------------
- /*let analyzePrices = array => {
- let maxValue;
- let minValue;
- for(i = 0; i <= array.length; i++){
- maxValue = Math.max.apply(null, array);
- minValue = Math.min.apply(null, array);
- }
- let max = array[0];
- let maxIndex = 0;
- let min = array[0];
- let minIndex = 0
- for (let i = 0; i < array.length; i++) {
- if (array[i] > max) {
- maxIndex = i;
- max = array[i];
- }
- if(array[i] < min){
- minIndex = i;
- min = array[i];
- }
- }
- }
- var prices = [1,2,3,4,5];
- analyzePrices(prices)*/
- //attempted to find the index with the the smallest number (minIndex) and then
- //the index with the largest number (maxIndex) and use those as the buy and sell properties
- //Had trouble making this work while also returning an object
- //--------------------------------------------------
- //Exercise: Fizz Buzz
- //--------------------------------------------------
- /* fizzBuzz = n => {
- if(n < 0){
- return ""
- }
- if(n > 0){
- for (var i = 1; i <= n; ++i) {
- if(i % 15 == 0){
- console.log("FizzBuzz");
- }
- else if (i % 3 == 0) {
- console.log("Fizz");
- } else if (i % 5 == 0) {
- console.log("Buzz");
- } else {
- console.log(i);
- }
- }
- }
- }
- console.log(fizzBuzz(15))*/
- //--------------------------------------------------
- //Exercise: Object Oriented Programming - Car
- //--------------------------------------------------
- /*function Car(){
- speed : 0,
- get sp() {
- return this.speed;
- }
- set speed(speed) {
- this.speed = speed;
- }
- function stop(){
- speed = 0;
- }
- }*/
- //Was adding the methods to get. set and stop and ran out of time before I could have a
- //working constructor
- </script>
- <script id="jsbin-source-javascript" type="text/javascript">//--------------------------------------------------
- //Name: Jesse Kosydor
- //--------------------------------------------------
- //--------------------------------------------------
- //Exercise: Property Path Evaluation
- //--------------------------------------------------
- /*let object = {
- }
- const propertyValueAt = (object, array) =>{
- }*/
- //--------------------------------------------------
- //Exercise: Sum Nested Arrays
- //--------------------------------------------------
- //--------------------------------------------------
- //Exercise: Word Count
- //--------------------------------------------------
- /*let wordCount = sentence => {
- str = sentence.split(" ");
- return str.length
- }
- console.log(wordCount("Hello World!"))*/
- //--------------------------------------------------
- //Exercise: Anagram Tester
- //--------------------------------------------------
- /*let areTheseAnagrams = (firstString, secondString) => {
- let areStringsEqual;
- let str1 = firstString.toLowerCase().split("").sort().join("");
- let str2 = secondString.toLowerCase().split("").sort().join("");
- str1.toLowerCase();
- str2.toLowerCase();
- console.log(str1)
- console.log(str2)
- if(str1 == str2){
- areStringsEqual = true;
- }else{
- areStringsEqual = false
- }
- return areStringsEqual
- }
- console.log(areTheseAnagrams("bad", "dba"));*/
- //--------------------------------------------------
- //Exercise: Analyze Prices
- //--------------------------------------------------
- /*let analyzePrices = array => {
- let maxValue;
- let minValue;
- for(i = 0; i <= array.length; i++){
- maxValue = Math.max.apply(null, array);
- minValue = Math.min.apply(null, array);
- }
- let max = array[0];
- let maxIndex = 0;
- let min = array[0];
- let minIndex = 0
- for (let i = 0; i < array.length; i++) {
- if (array[i] > max) {
- maxIndex = i;
- max = array[i];
- }
- if(array[i] < min){
- minIndex = i;
- min = array[i];
- }
- }
- }
- var prices = [1,2,3,4,5];
- analyzePrices(prices)*/
- //attempted to find the index with the the smallest number (minIndex) and then
- //the index with the largest number (maxIndex) and use those as the buy and sell properties
- //Had trouble making this work while also returning an object
- //--------------------------------------------------
- //Exercise: Fizz Buzz
- //--------------------------------------------------
- /* fizzBuzz = n => {
- if(n < 0){
- return ""
- }
- if(n > 0){
- for (var i = 1; i <= n; ++i) {
- if(i % 15 == 0){
- console.log("FizzBuzz");
- }
- else if (i % 3 == 0) {
- console.log("Fizz");
- } else if (i % 5 == 0) {
- console.log("Buzz");
- } else {
- console.log(i);
- }
- }
- }
- }
- console.log(fizzBuzz(15))*/
- //--------------------------------------------------
- //Exercise: Object Oriented Programming - Car
- //--------------------------------------------------
- /*function Car(){
- speed : 0,
- get sp() {
- return this.speed;
- }
- set speed(speed) {
- this.speed = speed;
- }
- function stop(){
- speed = 0;
- }
- }*/
- //Was adding the methods to get. set and stop and ran out of time before I could have a
- //working constructor
- </script></body>
- </html>
Add Comment
Please, Sign In to add comment