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: Kat Powell
- //--------------------------------------------------------------------------------
- //--------------------------------------------------------------------------------
- //Exercise: Property Path Evaluation
- //--------------------------------------------------------------------------------
- function propertyValueAt (cars, propertyArrary){
- var cars = { //created object with properties
- name: 'Honda',
- type: 'Sedan',
- var color = ['red', 'blue', 'green'];//added an array for color options
- };
- console.log(propertyValue());
- //--------------------------------------------------------------------------------
- //Exercise: Sum Nested Arrays
- //--------------------------------------------------------------------------------
- var array = [1, 2, 3, 4];
- function sumNested () {
- for( i = 0; i < array.length; i++){
- console.log(array.length);
- };
- console.log(sumNested);
- //--------------------------------------------------------------------------------
- //Exercise: Word Count
- //--------------------------------------------------------------------------------
- function wordCount (sentence) {
- if (sentence !== null && sentence !== ''){
- let wordArray = sentence.split('');
- return wordArray.length;
- } else {
- return 0;
- };
- var sentence = 'This is a short sentence';
- console.log(sentence.length);
- //--------------------------------------------------------------------------------
- //Exercise: Anagram Tester
- //--------------------------------------------------------------------------------
- var x = 'abc';
- var y = 'bcd';
- var z = 'cde';
- function areTheseArguments () {
- if (x === y) {
- console.log('true');
- if (y === z) {
- console.log('false');
- if (x === z) {
- console.log('false');
- };
- //--------------------------------------------------------------------------------
- //Exercise: Analyze Prices- Didn't get to complete
- //--------------------------------------------------------------------------------
- function analyzePrices
- const object = {
- buyIndex:
- sellIndex:
- };
- //--------------------------------------------------------------------------------
- //Exercise: Fizz Buzz
- //--------------------------------------------------------------------------------
- function fizzBuzz () {
- for( n = 1; n <= 100; n++)
- if( n % 3 === 0 && n % 5 ===0){
- console.log('fizzbuzz');
- } else if(n % 3 === 0) {
- console.log("fizz");
- } else if(i % 5 === 0) {
- console.log("buzz");
- } else (n <= 0) {
- console.log('empty string');
- } else ( n > 0) {
- console.log(n);
- }
- };
- console.log(fizzBuzz());
- //--------------------------------------------------------------------------------
- //Exercise: Object Oriented Programming - Car
- //--------------------------------------------------------------------------------
- function car (){
- function getSpeed(){
- this.speed >= 0;
- return this.speed;
- }
- function setSpeed(){
- this.speed >= 0;
- return this.speed;
- }
- function stop(){
- stop === 0;
- return stop;
- }
- };
- console.log(car.getSpeed());
- //--------------------------------------------------------------------------------
- //
- //--------------------------------------------------------------------------------
- </script>
- <script id="jsbin-source-javascript" type="text/javascript">//--------------------------------------------------------------------------------
- //Name: Kat Powell
- //--------------------------------------------------------------------------------
- //--------------------------------------------------------------------------------
- //Exercise: Property Path Evaluation
- //--------------------------------------------------------------------------------
- function propertyValueAt (cars, propertyArrary){
- var cars = { //created object with properties
- name: 'Honda',
- type: 'Sedan',
- var color = ['red', 'blue', 'green'];//added an array for color options
- };
- console.log(propertyValue());
- //--------------------------------------------------------------------------------
- //Exercise: Sum Nested Arrays
- //--------------------------------------------------------------------------------
- var array = [1, 2, 3, 4];
- function sumNested () {
- for( i = 0; i < array.length; i++){
- console.log(array.length);
- };
- console.log(sumNested);
- //--------------------------------------------------------------------------------
- //Exercise: Word Count
- //--------------------------------------------------------------------------------
- function wordCount (sentence) {
- if (sentence !== null && sentence !== ''){
- let wordArray = sentence.split('');
- return wordArray.length;
- } else {
- return 0;
- };
- var sentence = 'This is a short sentence';
- console.log(sentence.length);
- //--------------------------------------------------------------------------------
- //Exercise: Anagram Tester
- //--------------------------------------------------------------------------------
- var x = 'abc';
- var y = 'bcd';
- var z = 'cde';
- function areTheseArguments () {
- if (x === y) {
- console.log('true');
- if (y === z) {
- console.log('false');
- if (x === z) {
- console.log('false');
- };
- //--------------------------------------------------------------------------------
- //Exercise: Analyze Prices- Didn't get to complete
- //--------------------------------------------------------------------------------
- function analyzePrices
- const object = {
- buyIndex:
- sellIndex:
- };
- //--------------------------------------------------------------------------------
- //Exercise: Fizz Buzz
- //--------------------------------------------------------------------------------
- function fizzBuzz () {
- for( n = 1; n <= 100; n++)
- if( n % 3 === 0 && n % 5 ===0){
- console.log('fizzbuzz');
- } else if(n % 3 === 0) {
- console.log("fizz");
- } else if(i % 5 === 0) {
- console.log("buzz");
- } else (n <= 0) {
- console.log('empty string');
- } else ( n > 0) {
- console.log(n);
- }
- };
- console.log(fizzBuzz());
- //--------------------------------------------------------------------------------
- //Exercise: Object Oriented Programming - Car
- //--------------------------------------------------------------------------------
- function car (){
- function getSpeed(){
- this.speed >= 0;
- return this.speed;
- }
- function setSpeed(){
- this.speed >= 0;
- return this.speed;
- }
- function stop(){
- stop === 0;
- return stop;
- }
- };
- console.log(car.getSpeed());
- //--------------------------------------------------------------------------------
- //
- //--------------------------------------------------------------------------------
- </script></body>
- </html>
Add Comment
Please, Sign In to add comment