react-use-countdown/src/sample2.ts
2020-08-28 15:36:20 +07:00

12 lines
241 B
TypeScript

const sqrt = (n : number): number | undefined => {
if( typeof n === "undefined" || n === null){
return undefined
}
if(typeof n !== "number"){
return undefined
}
return Math.sqrt(n)
}
export default sqrt