add sample 2

This commit is contained in:
2020-08-28 15:36:20 +07:00
parent 9ced30ded5
commit d293ac3aa4
8 changed files with 71 additions and 12 deletions

View File

@@ -1,3 +1,5 @@
export { default as sample } from "./sample"
export { default as power } from "./sample"
export { default as sqrt } from "./sample2"

11
src/sample2.ts Normal file
View File

@@ -0,0 +1,11 @@
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