diff options
| author | EuAndreh <eu@euandre.org> | 2025-07-11 14:45:07 -0300 |
|---|---|---|
| committer | EuAndreh <eu@euandre.org> | 2025-07-11 14:45:07 -0300 |
| commit | a6a78f160e996d837a17896562af1017eb6fde25 (patch) | |
| tree | 8a69cdcca72c250115064353fc6937dc9a704cf2 /src/sjs.mjs | |
| parent | Use .mjs extension; add reduce(); finish tests; export names correctly. (diff) | |
| download | sjs-a6a78f160e996d837a17896562af1017eb6fde25.tar.gz sjs-a6a78f160e996d837a17896562af1017eb6fde25.tar.xz | |
src/sjs.mjs: Add isNumeric()
Diffstat (limited to 'src/sjs.mjs')
| -rw-r--r-- | src/sjs.mjs | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/src/sjs.mjs b/src/sjs.mjs index 0b2c705..2c9d551 100644 --- a/src/sjs.mjs +++ b/src/sjs.mjs @@ -1,6 +1,10 @@ export const max = (a, b) => a > b ? a : b; export const min = (a, b) => a < b ? a : b; +export const isNumeric = c => + c.charCodeAt(0) >= "0".charCodeAt(0) && + c.charCodeAt(0) <= "9".charCodeAt(0); + export const explode = s => s.split(""); export const getIn = (obj, path) => |
