카타 8급 Regular Ball Super Ball

1 개요[ | ]

카타 8급 C
# 🔗 문제 풀이

틀:카타 8급-4

2 JavaScript[ | ]

var Ball = function(ballType) {
  this.ballType = ballType || 'regular';
};
var Ball = function(ballType) {
  this.ballType = ballType ? ballType : "regular";
};
var Ball = function(ballType) {
  this.ballType = ballType==undefined ? 'regular' : ballType;
};
var Ball = function(ballType) {
    this.ballType = typeof ballType !== 'undefined' ? ballType : 'regular';
};
var Ball = function(ballType = "regular") {
  this.ballType = ballType;
};
class Ball {
  constructor(ballType = "regular") {
    this.ballType = ballType;
  }
}
문서 댓글 ({{ doc_comments.length }})
{{ comment.name }} {{ comment.created | snstime }}