Checks if the given file size is less than 1 MB.
This function helps enforce stricter size limits, useful for scenarios where smaller file sizes are required.
const fileSize = 0.8 * 1024 * 1024; // 0.8 MB in bytesconsole.log(isLt1M(fileSize)); // trueconst largeFileSize = 1.2 * 1024 * 1024; // 1.2 MB in bytesconsole.log(isLt1M(largeFileSize)); // false Copy
const fileSize = 0.8 * 1024 * 1024; // 0.8 MB in bytesconsole.log(isLt1M(fileSize)); // trueconst largeFileSize = 1.2 * 1024 * 1024; // 1.2 MB in bytesconsole.log(isLt1M(largeFileSize)); // false
The size of the file in bytes.
true if the file size is less than 1 MB, otherwise false.
true
false
Checks if the given file size is less than 1 MB.
This function helps enforce stricter size limits, useful for scenarios where smaller file sizes are required.
Example