Page Menu
Home
Phorge
Search
Configure Global Search
Log In
Files
F7538996
test_string_number_methods.cjs
No One
Temporary
Actions
View File
Edit File
Delete File
View Transforms
Subscribe
Flag For Later
Award Token
Size
1 KB
Referenced Files
None
Subscribers
None
test_string_number_methods.cjs
View Options
// Test String methods
console.log('String methods:');
console.log('"hello".toUpperCase() =', "hello".toUpperCase());
console.log('"HELLO".toLowerCase() =', "HELLO".toLowerCase());
console.log('" hello ".trim() =', " hello ".trim());
console.log('"abc".repeat(3) =', "abc".repeat(3));
console.log('"5".padStart(3, "0") =', "5".padStart(3, "0"));
console.log('"5".padEnd(3, "0") =', "5".padEnd(3, "0"));
console.log('"hello".charAt(1) =', "hello".charAt(1));
// Test Number methods
console.log('\nNumber methods:');
console.log('(42).toString() =', (42).toString());
console.log('(3.14159).toFixed(2) =', (3.14159).toFixed(2));
console.log('(123.456).toPrecision(4) =', (123.456).toPrecision(4));
console.log('(1234).toExponential(2) =', (1234).toExponential(2));
// Test parseInt and parseFloat
console.log('\nparseInt and parseFloat:');
console.log('parseInt("42") =', parseInt("42"));
console.log('parseInt("ff", 16) =', parseInt("ff", 16));
console.log('parseInt("1010", 2) =', parseInt("1010", 2));
console.log('parseFloat("3.14") =', parseFloat("3.14"));
console.log('parseFloat("3.14e2") =', parseFloat("3.14e2"));
File Metadata
Details
Attached
Mime Type
text/plain
Expires
Wed, Jun 17, 1:11 PM (1 d, 20 h)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
523850
Default Alt Text
test_string_number_methods.cjs (1 KB)
Attached To
Mode
rANT Ant
Attached
Detach File
Event Timeline
Log In to Comment