Giter Club home page Giter Club logo

md-introduction-to-the-dom-project-assignment-3's Introduction

MD-Introduction-To-The-DOM-Project-Assignment-3

md-introduction-to-the-dom-project-assignment-3's People

Contributors

rafuka avatar

Watchers

James Cloos avatar  avatar

md-introduction-to-the-dom-project-assignment-3's Issues

Feedback: Introduction to the DOM

Hi @rafuka,

utilities.values = function(obj) {
    if (! obj) throw "Error in function 'values': invalid 'obj' parameter."
    
    // Initialize array that will contain the object values
    var arr = [];
    
    // loop through the object keys, storing each value in the array
    for (var key in obj) {
      // add value to the array
      arr.push(obj[key]);
    }
    return arr;
  };

When you throw an exception in a function, don't give too much context (i.e, line numbers or function names). The JavaScript parser will usually do this for you. Just let the message be about the error that occurred.

The way you have defined your [utilities module] is not correct. Because you don't attach the utilities object to the window object, you module remains undefined.

 utilities.shuffle = function(arr) {
    if(! utilities.isArray(arr)) throw "Error in function 'shuffle': 'arr' parameter is not an array.";
    
    // store the number of elements in a variable
    var num = arr.length;
    
    // Loop through the array
    for (var i = 0; i < num; i++) {
      // create variable to hold the value on the current item
      var temp = arr[i];
      // calculate random index
      var randIndex = Math.floor(Math.random() * num);
      // swap value on current index with value on random index
      arr[i] = arr[randIndex];
      arr[randIndex] = temp;
    }
  };

The way you have written your comments above is not correct. Comments should usually be reserved for very complicated code/algorithms. In most cases choosing good function/variable names should make comments unnecessary.

You guys did an outstanding job on your team project. Bravo ๐Ÿ’ฏ

Thank you for the way you have organized your assignment. It is easy to go through and mark.

Please put all your projects on Github pages or another site host so that they be accessible online, you can also put them on codepen. Reply to this issue (or preferrably email supprt) when you have finished doing so.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.