day 11
This commit is contained in:
Executable
+10
@@ -0,0 +1,10 @@
|
||||
function capitalizeFirstLetter(target) {
|
||||
if (typeof target !== 'string') {
|
||||
throw new Error('Parameter should be a string.');
|
||||
}
|
||||
return target?.substring(0, 1).toUpperCase() + target?.substring(1)?.toLocaleLowerCase();
|
||||
}
|
||||
|
||||
module.exports = {
|
||||
capitalizeFirstLetter,
|
||||
};
|
||||
Reference in New Issue
Block a user