Giter VIP home page Giter VIP logo

harry_potter's People

Contributors

evan-leee avatar

Watchers

 avatar  avatar  avatar  avatar

harry_potter's Issues

Code Review Issues - 01

作业算法上挺取巧的,类的设计上,尤其是属性方面需要多思考。

文件代码行 Comments
spec/basket-spec.js line 72 将 basket.isNull() 函数返回值设置为false是否比undefined更有可读性
src/basket.js line 50 方法 isNull 中 如果temp.length 不等于0,返回 false 比不处理 更有可读性
src/basket.js line 5-6-7 将 bookVarity totalQuantity设置为属性还是设置为方法更好,basket 中只知道有一堆 books 就好了,其实可以交给他的方法来完成
src/basket.js line 12 方法 addBook 中 totalQuantity 是 basket 中书的总数吗,那直接就是 books 的长度,不需要一个一个累加
src/basket.js line 44 方法 updateVarity 中 没有什么update的意思,update 是体现在 reduceQuantity 中的,这里可以改成 getVarity 之类的
src/discounter.js line 2 lodash没有用到,可以去除
src/discounter.js line 5 可以思考将三个变量作为属性还是直接作为方法的区别,而且写死成5个变量着实有点生硬
src/discounter.js line 11 / line 26 方法calculate 和 discount 都在修改对象本身的状态,搞不清楚当前状态到底是什么了
src/discounter.js line 12 魔法数字 8 ,请替换成常量
src/main.js line 24 注意队形

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.