clean-codejs-objects

安装量: 70
排名: #10938

安装

npx skills add https://github.com/damianwrooby/javascript-clean-code-skills --skill clean-codejs-objects

Clean Code JavaScript – Object & Class Patterns Table of Contents Encapsulation Immutability Cohesion Encapsulation // ❌ Bad user . name = 'John' ; // ✅ Good user . rename ( 'John' ) ; Immutability // ❌ Bad user . age ++ ; // ✅ Good const updatedUser = user . withAge ( user . age + 1 ) ; Cohesion // ❌ Bad class User { calculateTax ( ) { } } // ✅ Good class TaxCalculator { calculate ( user ) { } }

返回排行榜