본문 바로가기
알고리즘/Codewars

[Codewars] Super Duper Easy (8 kyu) / JavaScript

by fluss 2023. 4. 19.

https://www.codewars.com/kata/55a5bfaa756cfede78000026

 

Codewars - Achieve mastery through coding practice and developer mentorship

A coding practice website for all programming levels – Join a community of over 3 million developers and improve your coding skills in over 55 programming languages!

www.codewars.com

 

DESCRIPTION:

Make a function that returns the value multiplied by 50 and increased by 6. If the value entered is a string it should return "Error".

 

코드

function problem(x){
  return typeof x === 'string'? "Error" : x * 50 + 6;
}

댓글