연간 연간 결제 시 모든 유료 요금제에서 2개월 무료. 요금제 보기
로그인 무료로 시작

코드 리뷰

입력
코드
function add(a, b) { return a + b; }
예시 결과 27 10월 2026에 생성됨

Bugs

  • Line 1: Parameters a and b have implicit any types when noImplicitAny is enabled.
  • Line 1: The return type is unspecified. Because + behaves differently for numbers and strings, the function’s intended behavior is ambiguous.

Security

  • No direct security vulnerabilities are present.
  • Explicit numeric types prevent unintended string concatenation or coercion when this function is used with loosely typed input.

Performance

  • The implementation is already optimal for numeric addition.
  • No additional allocations or unnecessary operations are performed.

Style

  • Add parameter and return type annotations for clarity and type safety.
  • Expand the one-line function to improve readability and maintainability.
function add(a: number, b: number): number {
  return a + b;
}
이걸로 시작 코드 리뷰 이 예시의 입력이 채워진 채로 양식이 열립니다. 무엇이든 바꿀 수 있어요.