Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <!DOCTYPE html>
- <html>
- <script>
- var Meo = function(trongluong){
- var self = this;
- self.trongLuong = trongluong;
- self.batChuot = function(chuot){
- self.trongLuong += chuot.trongLuong;
- console.log(self.trongLuong);
- }
- }
- var Chuot = function(trongluong){
- var self = this;
- this.trongLuong = trongluong;
- }
- var meo1 = new Meo(2000);
- var chuot1 = new Chuot(200);
- var chuot2 = new Chuot(300);
- var chuot3 = new Chuot(400);
- meo1.batChuot(chuot1);
- meo1.batChuot(chuot2);
- meo1.batChuot(chuot3);
- </script>
- </html>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement