Page Menu
Home
Phorge
Search
Configure Global Search
Log In
Files
F7540847
test_three_params.js
No One
Temporary
Actions
View File
Edit File
Delete File
View Transforms
Subscribe
Flag For Later
Award Token
Size
634 B
Referenced Files
None
Subscribers
None
test_three_params.js
View Options
// Test method with 3 parameters where last 2 have defaults
class
Formatter
{
wrap
(
text
,
left
=
'('
,
right
=
')'
)
{
console
.
log
(
'wrap called with:'
,
text
,
left
,
right
);
return
left
+
text
+
right
;
}
}
console
.
log
(
"Test 1 - All 3 params provided:"
);
const
fmt
=
new
Formatter
();
const
result1
=
fmt
.
wrap
(
'test'
,
'<'
,
'>'
);
console
.
log
(
'Result:'
,
result1
);
console
.
log
(
"\nTest 2 - Only first param (2 defaults):"
);
const
result2
=
fmt
.
wrap
(
'test'
);
console
.
log
(
'Result:'
,
result2
);
console
.
log
(
"\nTest 3 - First 2 params (1 default):"
);
const
result3
=
fmt
.
wrap
(
'test'
,
'['
);
console
.
log
(
'Result:'
,
result3
);
File Metadata
Details
Attached
Mime Type
text/plain
Expires
Wed, Jun 17, 1:48 PM (1 d, 4 h)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
524066
Default Alt Text
test_three_params.js (634 B)
Attached To
Mode
rANT Ant
Attached
Detach File
Event Timeline
Log In to Comment