0.2.10 • Published 2 years ago
jsshort v0.2.10
Short functions
npm i jsshort
you can use like this
require("jsshort")
let integerValue = int("3") // here int is short function
console.log(integerValue)like this there are many functions
input; print int; str; float; bool; array;
Input output functions:
require("jsshort")
async function sum {
let a = await input("Enter first number: ")
let b = await input("Enter 2nd number: ")
print("Sum of both numbers:", end=" ");
print(int(a) + int(b))
}
sum();require("jsshort")
async function sum {
let a = await input("Enter first number: ")
let b = await input("Enter 2nd number: ")
// it will store Output of this function in output.txt file
print("Sum of both numbers:", int(a) + int(b), {file: "./path/output.txt"});
}
sum();Input output functions in typescript
import f from "jsshort";
async function sum {
let a:string = await f.input("Enter first number: ")
let b:string = await f.input("Enter 2nd number: ")
f.print("Sum of both numbers:", {end: " "});
f.print(f.int(a) + f.int(b))
}
sum();String functions Uses example
require("jsshort")
let stringg = "This is my string"
let length =string.len(); // uses of len function
console.log(length)more functions name len str add sb ind lstInd inString start end upr lwr trS trE rpc rpcA at chCdAt locCmp
There are many array functions: Uses example
require("jsshort")
let arr1 = [1, 2, 3]
let arr2 = [4, 5]
let newArray = arr1.add(arr2) // uses of add function
console.log(newArray)more functions: add ind lstInd inArray forE rdc rdcR fndInd