mirror of
https://github.com/TheAlgorithms/JavaScript.git
synced 2026-03-13 15:21:15 +08:00
fixed some spellings
This commit is contained in:
@@ -22,9 +22,9 @@ const DateDayDifference = (date1, date2) => {
|
||||
if (typeof date1 !== 'string' && typeof date2 !== 'string') {
|
||||
return new TypeError('Argument is not a string.')
|
||||
}
|
||||
// extarct the first date
|
||||
// extract the first date
|
||||
const [firstDateDay, firstDateMonth, firstDateYear] = date1.split('/').map((ele) => Number(ele))
|
||||
// extarct the second date
|
||||
// extract the second date
|
||||
const [secondDateDay, secondDateMonth, secondDateYear] = date2.split('/').map((ele) => Number(ele))
|
||||
// check the both data are valid or not.
|
||||
if (firstDateDay < 0 || firstDateDay > 31 ||
|
||||
|
||||
@@ -44,7 +44,7 @@ const DateToDay = (date) => {
|
||||
if (typeof date !== 'string') {
|
||||
return new TypeError('Argument is not a string.')
|
||||
}
|
||||
// extarct the date
|
||||
// extract the date
|
||||
const [day, month, year] = date.split('/').map((x) => Number(x))
|
||||
// check the data are valid or not.
|
||||
if (day < 0 || day > 31 || month > 12 || month < 0) {
|
||||
|
||||
@@ -5,7 +5,7 @@
|
||||
want some changes in hour value.
|
||||
|
||||
Input Formate -> 07:05:45PM
|
||||
Output Fromate -> 19:05:45
|
||||
Output Formate -> 19:05:45
|
||||
|
||||
Problem & Explanation Source : https://www.mathsisfun.com/time.html
|
||||
*/
|
||||
|
||||
@@ -8,7 +8,7 @@
|
||||
* @returns {String}
|
||||
*/
|
||||
const TitleCaseConversion = (inputString) => {
|
||||
// Extact all space seprated string.
|
||||
// Extract all space separated string.
|
||||
const stringCollections = inputString.split(' ').map(word => {
|
||||
let firstChar = ''
|
||||
// Get a character code by the use charCodeAt method.
|
||||
|
||||
Reference in New Issue
Block a user