Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <!DOCTYPE html>
- <html>
- <head>
- <title></title>
- </head>
- <body>
- <script>
- function Caneta(preco, cor){
- var color = cor || 'balck';
- this.preco = preco || 1;
- this.mudarCor = function(cor){
- if(cor !== 'red' && cor !== 'blue' && cor !== 'black'){
- return;
- }else{
- color = cor;
- }
- }
- this.pegaCor = function(){
- return color;
- }
- }
- var caneta1 = new Caneta(2,'red');
- </script>
- </body>
- </html>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement