fork(1) download
  1. // your code goes here
  2. function Animal(type, name){
  3. this.family = type
  4. this.type = type
  5. if (name !=null){
  6. this.name =type
  7. }else{
  8. this.name = name
  9. }
  10. this.log =function(){
  11. return 'I am a ' +this.type+(this.name==this.type)?'.':', people cal me just '+this.name
  12. }
  13. }
  14. hmls=new Animal('Dog', 'Homeless dog')
  15. console.log(hmls.log())
Success #stdin #stdout 0.04s 16700KB
stdin
Standard input is empty
stdout
.