From dd42ff02841c40926b552b8b7587e6980f846cee Mon Sep 17 00:00:00 2001 From: Ahmad Hmedan Date: Fri, 17 Oct 2025 09:07:23 +0100 Subject: [PATCH 01/10] the key-errors issues has been solved --- Sprint-2/1-key-errors/0.js | 21 ++++++++++++++------- Sprint-2/1-key-errors/1.js | 26 ++++++++++++++++++-------- Sprint-2/1-key-errors/2.js | 19 +++++++++++-------- 3 files changed, 43 insertions(+), 23 deletions(-) diff --git a/Sprint-2/1-key-errors/0.js b/Sprint-2/1-key-errors/0.js index 653d6f5a0..52cc1de97 100644 --- a/Sprint-2/1-key-errors/0.js +++ b/Sprint-2/1-key-errors/0.js @@ -1,13 +1,20 @@ // Predict and explain first... -// =============> write your prediction here +// =============> I predict it will throw a syntaxerror because the parameter 'str' is already declare in the definition, +//and line 9 try to declare another variable with the same name so the error will be identifier 'str'has already been declared . + // call the function capitalise with a string input // interpret the error message and figure out why an error is occurring -function capitalise(str) { - let str = `${str[0].toUpperCase()}${str.slice(1)}`; - return str; -} +// function capitalise(str) { +// let str = `${str[0].toUpperCase()}${str.slice(1)}`; +// return str; +// } +// capitalise("ahmadhmedan"); -// =============> write your explanation here -// =============> write your new code here +// =============> As I predict it will throw a SyntaxError: Identifier 'str' has already been declared +//because in JavaScript we can not redeclare the same variable in the same scope. +function Capitalise(str){ + return `${str[0].toUpperCase()}${str.slice(1)}`; +} +console.log(Capitalise("ahmadHmedan")); diff --git a/Sprint-2/1-key-errors/1.js b/Sprint-2/1-key-errors/1.js index f2d56151f..ac5c2f632 100644 --- a/Sprint-2/1-key-errors/1.js +++ b/Sprint-2/1-key-errors/1.js @@ -2,19 +2,29 @@ // Why will an error occur when this program runs? // =============> write your prediction here - +// my prediction it will throw a syntaxerror because the parameter decimalNumber is already declare in the definition. +//and line 11 try to declare another variable with the same name so the error will be identifier 'str'has already been declared . +// // Try playing computer with the example to work out what is going on -function convertToPercentage(decimalNumber) { - const decimalNumber = 0.5; - const percentage = `${decimalNumber * 100}%`; +// function convertToPercentage(decimalNumber) { +// const decimalNumber = 0.5; +// const percentage = `${decimalNumber * 100}%`; - return percentage; -} +// return percentage; +// } -console.log(decimalNumber); +// console.log(decimalNumber); -// =============> write your explanation here +// =============> As I predicted, SyntaxError: Identifier 'decimalNumber' has already been declared // Finally, correct the code to fix the problem // =============> write your new code here +function convertToPercentage(decimalNumber) { + + const percentage = `${decimalNumber * 100}%`; + + return percentage; +} + +console.log(convertToPercentage(0.5)); diff --git a/Sprint-2/1-key-errors/2.js b/Sprint-2/1-key-errors/2.js index aad57f7cf..91ceb4891 100644 --- a/Sprint-2/1-key-errors/2.js +++ b/Sprint-2/1-key-errors/2.js @@ -3,18 +3,21 @@ // this function should square any number but instead we're going to get an error -// =============> write your prediction of the error here +// =============> // It will throw a syntaxerror because in the function definition we sit the parameter name not the value -function square(3) { - return num * num; -} +// function square(3) { +// return num * num; +// } -// =============> write the error message here +// =============> SyntaxError: Unexpected number -// =============> explain this error message here +// =============> As I predicted we must set the parameter name in the definition // Finally, correct the code to fix the problem -// =============> write your new code here - +// =============> + function square(num) { + return num * num; +} +console.log(square(3)); From 4dffed1446d88a2e0d5c30e35528c4606c1b2f86 Mon Sep 17 00:00:00 2001 From: Ahmad Hmedan Date: Sun, 19 Oct 2025 15:41:53 +0100 Subject: [PATCH 02/10] the 2-mandatory-debug has been solved --- Sprint-2/2-mandatory-debug/0.js | 17 +++++++++------ Sprint-2/2-mandatory-debug/1.js | 19 ++++++++++------- Sprint-2/2-mandatory-debug/2.js | 37 +++++++++++++++++++++++---------- 3 files changed, 49 insertions(+), 24 deletions(-) diff --git a/Sprint-2/2-mandatory-debug/0.js b/Sprint-2/2-mandatory-debug/0.js index b27511b41..abb3a7405 100644 --- a/Sprint-2/2-mandatory-debug/0.js +++ b/Sprint-2/2-mandatory-debug/0.js @@ -1,14 +1,19 @@ // Predict and explain first... -// =============> write your prediction here +// =============> it will throw a syntaxerror because I can not use nested console.log. -function multiply(a, b) { - console.log(a * b); -} +// function multiply(a, b) { +// console.log(a * b); +// } -console.log(`The result of multiplying 10 and 32 is ${multiply(10, 32)}`); +// console.log(`The result of multiplying 10 and 32 is ${multiply(10, 32)}`); -// =============> write your explanation here +// =============> The result of multiplying 10 and 32 is undefined undefined because If I want to keep the value with me after the function finishes, I must use return. // Finally, correct the code to fix the problem // =============> write your new code here +function multiply(a, b) { + return(a*b); +} + +console.log(`The result of multiplying 10 and 32 is ${multiply(10, 32)}`); diff --git a/Sprint-2/2-mandatory-debug/1.js b/Sprint-2/2-mandatory-debug/1.js index 37cedfbcf..1598b4450 100644 --- a/Sprint-2/2-mandatory-debug/1.js +++ b/Sprint-2/2-mandatory-debug/1.js @@ -1,13 +1,18 @@ // Predict and explain first... -// =============> write your prediction here +// =============> It will not return the value. -function sum(a, b) { - return; - a + b; -} +// function sum(a, b) { +// return; +// a + b; +// } -console.log(`The sum of 10 and 32 is ${sum(10, 32)}`); +// console.log(`The sum of 10 and 32 is ${sum(10, 32)}`); -// =============> write your explanation here +// =============> any think we do after return will not coding. // Finally, correct the code to fix the problem // =============> write your new code here +function sum(a, b) { + return a+b; +} + +console.log(`The sum of 10 and 32 is ${sum(10, 32)}`); \ No newline at end of file diff --git a/Sprint-2/2-mandatory-debug/2.js b/Sprint-2/2-mandatory-debug/2.js index 57d3f5dc3..025d7dfff 100644 --- a/Sprint-2/2-mandatory-debug/2.js +++ b/Sprint-2/2-mandatory-debug/2.js @@ -1,24 +1,39 @@ // Predict and explain first... // Predict the output of the following code: -// =============> Write your prediction here +// =============> first it will convert the number to string then it will slice the last character that function +//then will print +//The last digit of 42 os 2 +//The last digit of 105 os 5 +//The last digit of 806 os 6 -const num = 103; +// const num = 103; -function getLastDigit() { - return num.toString().slice(-1); -} +// function getLastDigit() { +// return num.toString().slice(-1); +// } -console.log(`The last digit of 42 is ${getLastDigit(42)}`); -console.log(`The last digit of 105 is ${getLastDigit(105)}`); -console.log(`The last digit of 806 is ${getLastDigit(806)}`); +// console.log(`The last digit of 42 is ${getLastDigit(42)}`); +// console.log(`The last digit of 105 is ${getLastDigit(105)}`); +// console.log(`The last digit of 806 is ${getLastDigit(806)}`); // Now run the code and compare the output to your prediction -// =============> write the output here +// =============> The last digit of 42 is 3 +//The last digit of 105 is 3 +//The last digit of 806 is 3 // Explain why the output is the way it is -// =============> write your explanation here +// =============> Because the function always takes the global variable witch is 103 +//the output will be the same witch 3. // Finally, correct the code to fix the problem -// =============> write your new code here +// =============> write your new code her + +function getLastDigit(num) { + return num.toString().slice(-1); +} + +console.log(`The last digit of 42 is ${getLastDigit(42)}`); +console.log(`The last digit of 105 is ${getLastDigit(105)}`); +console.log(`The last digit of 806 is ${getLastDigit(806)}`); // This program should tell the user the last digit of each number. // Explain why getLastDigit is not working properly - correct the problem From b0b099072c2f0c05314b341bd41d5b4cff616fdb Mon Sep 17 00:00:00 2001 From: Ahmad Hmedan Date: Sun, 19 Oct 2025 19:43:38 +0100 Subject: [PATCH 03/10] The 3-to-pounds.js has been solved --- Sprint-2/3-mandatory-implement/1-bmi.js | 6 ++++-- Sprint-2/3-mandatory-implement/2-cases.js | 19 +++++++++++++++++++ Sprint-2/3-mandatory-implement/3-to-pounds.js | 11 +++++++++++ 3 files changed, 34 insertions(+), 2 deletions(-) diff --git a/Sprint-2/3-mandatory-implement/1-bmi.js b/Sprint-2/3-mandatory-implement/1-bmi.js index 17b1cbde1..3934eb2a5 100644 --- a/Sprint-2/3-mandatory-implement/1-bmi.js +++ b/Sprint-2/3-mandatory-implement/1-bmi.js @@ -15,5 +15,7 @@ // It should return their Body Mass Index to 1 decimal place function calculateBMI(weight, height) { - // return the BMI of someone based off their weight and height -} \ No newline at end of file + let BMI=weight/(height*height); + return BMI.toFixed(1); +} +console.log(calculateBMI(70,1.73)); \ No newline at end of file diff --git a/Sprint-2/3-mandatory-implement/2-cases.js b/Sprint-2/3-mandatory-implement/2-cases.js index 5b0ef77ad..53d8a4b22 100644 --- a/Sprint-2/3-mandatory-implement/2-cases.js +++ b/Sprint-2/3-mandatory-implement/2-cases.js @@ -14,3 +14,22 @@ // You will need to come up with an appropriate name for the function // Use the MDN string documentation to help you find a solution // This might help https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String/toUpperCase + +function ConvertToUpperSnakeCase(s1) +{ + let result = ""; + for(let i=0;i Date: Mon, 20 Oct 2025 09:42:35 +0100 Subject: [PATCH 04/10] time-format.js has been solved --- Sprint-2/4-mandatory-interpret/time-format.js | 13 +++++++------ 1 file changed, 7 insertions(+), 6 deletions(-) diff --git a/Sprint-2/4-mandatory-interpret/time-format.js b/Sprint-2/4-mandatory-interpret/time-format.js index 7c98eb0e8..e42364b9a 100644 --- a/Sprint-2/4-mandatory-interpret/time-format.js +++ b/Sprint-2/4-mandatory-interpret/time-format.js @@ -3,13 +3,14 @@ function pad(num) { } function formatTimeDisplay(seconds) { - const remainingSeconds = seconds % 60; + const remainingSeconds = seconds % 60; const totalMinutes = (seconds - remainingSeconds) / 60; const remainingMinutes = totalMinutes % 60; const totalHours = (totalMinutes - remainingMinutes) / 60; return `${pad(totalHours)}:${pad(remainingMinutes)}:${pad(remainingSeconds)}`; } +console.log(formatTimeDisplay(61)); // You will need to play computer with this example - use the Python Visualiser https://pythontutor.com/visualize.html#mode=edit // to help you answer these questions @@ -17,18 +18,18 @@ function formatTimeDisplay(seconds) { // Questions // a) When formatTimeDisplay is called how many times will pad be called? -// =============> write your answer here +// =============> Three time // Call formatTimeDisplay with an input of 61, now answer the following: // b) What is the value assigned to num when pad is called for the first time? -// =============> write your answer here +// =============> num =0 // c) What is the return value of pad is called for the first time? -// =============> write your answer here +// =============> return value='00' // d) What is the value assigned to num when pad is called for the last time in this program? Explain your answer -// =============> write your answer here +// =============> num=1 because it will take the value of remainingseconda which is 1; // e) What is the return value assigned to num when pad is called for the last time in this program? Explain your answer -// =============> write your answer here +// =============> return value ='01' it will take number 1 then will convert to sting then it will add 0 to the first because it is only one character . From 785e8e712db2f42e21a69edd2e26bb97aacf328e Mon Sep 17 00:00:00 2001 From: Ahmad Hmedan Date: Mon, 20 Oct 2025 09:57:56 +0100 Subject: [PATCH 05/10] I added two edages assertion both are failed and I rewrite the code to solve this issue --- Sprint-2/5-stretch-extend/format-time.js | 65 ++++++++++++++++++++++++ 1 file changed, 65 insertions(+) diff --git a/Sprint-2/5-stretch-extend/format-time.js b/Sprint-2/5-stretch-extend/format-time.js index 32a32e66b..df62b854c 100644 --- a/Sprint-2/5-stretch-extend/format-time.js +++ b/Sprint-2/5-stretch-extend/format-time.js @@ -23,3 +23,68 @@ console.assert( currentOutput2 === targetOutput2, `current output: ${currentOutput2}, target output: ${targetOutput2}` ); +const currentOutput3=formatAs12HourClock("00:00"); +const targetOutput3="12:00 am"; +console.assert(currentOutput3===targetOutput3, + `current output: ${currentOutput3}, target output: ${targetOutput3}` +) +const currentOutput4=formatAs12HourClock("12:00"); +const targetOutput4="12:00 pm"; +console.assert(currentOutput4===targetOutput4, + `current output: ${currentOutput4}, target output: ${targetOutput4}` +) + + +// This is my version +function TimeAs12hours(time) { + const hours = Number(time.slice(0, 2)); + const minutes = time.slice(3); + if (hours === 0) { + return `12:${minutes} am`; + } else if (hours > 12) { + return `${hours - 12}:${minutes} pm`; + } else if (hours === 12) { + return `${time} pm`; + } + return `${time} am`; +} + +let currentTime = TimeAs12hours("12:02"); +let targetTime = "12:02 pm"; +console.assert( + currentTime === targetTime, + `current time:${currentTime}, Target Time:${targetTime}` +); +currentTime = TimeAs12hours("10:30"); +targetTime = "10:30 am"; +console.assert( + currentTime === targetTime, + `current time:${currentTime}, Target Time:${targetTime}` +); + +currentTime = TimeAs12hours("04:30"); +targetTime = "04:30 am"; +console.assert( + currentTime === targetTime, + `current time:${currentTime}, Target Time:${targetTime}` +); + +currentTime = TimeAs12hours("13:30"); +targetTime = "1:30 pm"; +console.assert( + currentTime === targetTime, + `current time:${currentTime}, Target Time:${targetTime}` +); +currentTime = TimeAs12hours("23:09"); +targetTime = "11:09 pm"; +console.assert( + currentTime === targetTime, + `current time:${currentTime}, Target Time:${targetTime}` +); + +currentTime = TimeAs12hours("00:00"); +targetTime = "12:00 am"; +console.assert( + currentTime === targetTime, + `current time:${currentTime}, Target Time:${targetTime}` +); \ No newline at end of file From 10a99cc826c585f211647dbd9bdaca1bb1598d97 Mon Sep 17 00:00:00 2001 From: Ahmad Hmedan Date: Fri, 24 Oct 2025 09:39:53 +0100 Subject: [PATCH 06/10] Change the variable name --- Sprint-2/1-key-errors/0.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/Sprint-2/1-key-errors/0.js b/Sprint-2/1-key-errors/0.js index 52cc1de97..e93244a4d 100644 --- a/Sprint-2/1-key-errors/0.js +++ b/Sprint-2/1-key-errors/0.js @@ -14,7 +14,7 @@ // =============> As I predict it will throw a SyntaxError: Identifier 'str' has already been declared //because in JavaScript we can not redeclare the same variable in the same scope. -function Capitalise(str){ +function capitalise(str){ return `${str[0].toUpperCase()}${str.slice(1)}`; } -console.log(Capitalise("ahmadHmedan")); +console.log(capitalise("ahmadHmedan")); From daff1161c50b3063b24574b1609f666d9ef2d207 Mon Sep 17 00:00:00 2001 From: Ahmad Hmedan Date: Fri, 24 Oct 2025 21:07:14 +0100 Subject: [PATCH 07/10] delete let and return the valeu dirctly without using any variable declertion --- Sprint-2/3-mandatory-implement/1-bmi.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/Sprint-2/3-mandatory-implement/1-bmi.js b/Sprint-2/3-mandatory-implement/1-bmi.js index 3934eb2a5..1c3744b27 100644 --- a/Sprint-2/3-mandatory-implement/1-bmi.js +++ b/Sprint-2/3-mandatory-implement/1-bmi.js @@ -15,7 +15,7 @@ // It should return their Body Mass Index to 1 decimal place function calculateBMI(weight, height) { - let BMI=weight/(height*height); - return BMI.toFixed(1); + return (weight/(height*height)).toFixed(1); + } console.log(calculateBMI(70,1.73)); \ No newline at end of file From 95b418413f08488ce9519f17f336bfbd1e3eba95 Mon Sep 17 00:00:00 2001 From: Ahmad Hmedan Date: Fri, 24 Oct 2025 21:17:29 +0100 Subject: [PATCH 08/10] using existing library instead create a new function from scratch --- Sprint-2/3-mandatory-implement/2-cases.js | 36 +++++++++++++---------- 1 file changed, 20 insertions(+), 16 deletions(-) diff --git a/Sprint-2/3-mandatory-implement/2-cases.js b/Sprint-2/3-mandatory-implement/2-cases.js index 53d8a4b22..03b0dd4a7 100644 --- a/Sprint-2/3-mandatory-implement/2-cases.js +++ b/Sprint-2/3-mandatory-implement/2-cases.js @@ -15,21 +15,25 @@ // Use the MDN string documentation to help you find a solution // This might help https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String/toUpperCase -function ConvertToUpperSnakeCase(s1) -{ - let result = ""; - for(let i=0;i Date: Fri, 24 Oct 2025 21:40:41 +0100 Subject: [PATCH 09/10] Final updates before need review, and use format document --- Sprint-2/3-mandatory-implement/2-cases.js | 4 +- Sprint-2/3-mandatory-implement/3-to-pounds.js | 14 ++-- Sprint-2/5-stretch-extend/format-time.js | 68 ++++++++++--------- 3 files changed, 45 insertions(+), 41 deletions(-) diff --git a/Sprint-2/3-mandatory-implement/2-cases.js b/Sprint-2/3-mandatory-implement/2-cases.js index 03b0dd4a7..ddcfb3ed2 100644 --- a/Sprint-2/3-mandatory-implement/2-cases.js +++ b/Sprint-2/3-mandatory-implement/2-cases.js @@ -28,8 +28,8 @@ // else // result+=s1[i]; // } -// let UPPER_SNAKE_CASE=result.toUpperCase(); -// return UPPER_SNAKE_CASE; +// let upperSnakeCase=result.toUpperCase(); +// return upperSnakeCase; // } // console.log(ConvertToUpperSnakeCase("Ahmad Hmedan")); diff --git a/Sprint-2/3-mandatory-implement/3-to-pounds.js b/Sprint-2/3-mandatory-implement/3-to-pounds.js index d67b080fe..761606f6c 100644 --- a/Sprint-2/3-mandatory-implement/3-to-pounds.js +++ b/Sprint-2/3-mandatory-implement/3-to-pounds.js @@ -5,13 +5,11 @@ // You should call this function a number of times to check it works for different inputs - -function toPound(penceString) -{ - const penceWithoutP=penceString.substring(0,penceString.length-1); - const paddedPence=penceWithoutP.padStart(3,"0"); - const pound=paddedPence.substring(0,paddedPence.length-2); - const Pence=paddedPence.substring(paddedPence.length-2); - return `£${pound}.${Pence}` +function toPound(penceString) { + const penceWithoutP = penceString.substring(0, penceString.length - 1); + const paddedPence = penceWithoutP.padStart(3, "0"); + const pound = paddedPence.substring(0, paddedPence.length - 2); + const Pence = paddedPence.substring(paddedPence.length - 2); + return `£${pound}.${Pence}`; } console.log(toPound("100p")); diff --git a/Sprint-2/5-stretch-extend/format-time.js b/Sprint-2/5-stretch-extend/format-time.js index df62b854c..6b58e7308 100644 --- a/Sprint-2/5-stretch-extend/format-time.js +++ b/Sprint-2/5-stretch-extend/format-time.js @@ -1,38 +1,37 @@ // This is the latest solution to the problem from the prep. // Make sure to do the prep before you do the coursework -// Your task is to write tests for as many different groups of input data or edge cases as you can, and fix any bugs you find. +// +// function formatAs12HourClock(time) { +// const hours = Number(time.slice(0, 2)); +// if (hours > 12) { +// return `${hours - 12}:00 pm`; +// } +// return `${time} am`; +// } -function formatAs12HourClock(time) { - const hours = Number(time.slice(0, 2)); - if (hours > 12) { - return `${hours - 12}:00 pm`; - } - return `${time} am`; -} - -const currentOutput = formatAs12HourClock("08:00"); -const targetOutput = "08:00 am"; -console.assert( - currentOutput === targetOutput, - `current output: ${currentOutput}, target output: ${targetOutput}` -); +// const currentOutput = formatAs12HourClock("08:00"); +// const targetOutput = "08:00 am"; +// console.assert( +// currentOutput === targetOutput, +// `current output: ${currentOutput}, target output: ${targetOutput}` +// ); -const currentOutput2 = formatAs12HourClock("23:00"); -const targetOutput2 = "11:00 pm"; -console.assert( - currentOutput2 === targetOutput2, - `current output: ${currentOutput2}, target output: ${targetOutput2}` -); -const currentOutput3=formatAs12HourClock("00:00"); -const targetOutput3="12:00 am"; -console.assert(currentOutput3===targetOutput3, - `current output: ${currentOutput3}, target output: ${targetOutput3}` -) -const currentOutput4=formatAs12HourClock("12:00"); -const targetOutput4="12:00 pm"; -console.assert(currentOutput4===targetOutput4, - `current output: ${currentOutput4}, target output: ${targetOutput4}` -) +// const currentOutput2 = formatAs12HourClock("23:00"); +// const targetOutput2 = "11:00 pm"; +// console.assert( +// currentOutput2 === targetOutput2, +// `current output: ${currentOutput2}, target output: ${targetOutput2}` +// ); +// const currentOutput3=formatAs12HourClock("00:00"); +// const targetOutput3="12:00 am"; +// console.assert(currentOutput3===targetOutput3, +// `current output: ${currentOutput3}, target output: ${targetOutput3}` +// ) +// const currentOutput4=formatAs12HourClock("12:00"); +// const targetOutput4="12:00 pm"; +// console.assert(currentOutput4===targetOutput4, +// `current output: ${currentOutput4}, target output: ${targetOutput4}` +// ) // This is my version @@ -84,6 +83,13 @@ console.assert( currentTime = TimeAs12hours("00:00"); targetTime = "12:00 am"; +console.assert( + currentTime === targetTime, + `current time:${currentTime}, Target Time:${targetTime}` +); + +currentTime=TimeAs12hours("12:00"); +targetTime="12:00 pm"; console.assert( currentTime === targetTime, `current time:${currentTime}, Target Time:${targetTime}` From e563c47a41e7262172c2b622cc68173346d5b206 Mon Sep 17 00:00:00 2001 From: Ahmad Hmedan Date: Fri, 24 Oct 2025 21:41:07 +0100 Subject: [PATCH 10/10] Final updates before need review, and use format document --- Sprint-2/5-stretch-extend/format-time.js | 11 +++++------ 1 file changed, 5 insertions(+), 6 deletions(-) diff --git a/Sprint-2/5-stretch-extend/format-time.js b/Sprint-2/5-stretch-extend/format-time.js index 6b58e7308..dc788fa32 100644 --- a/Sprint-2/5-stretch-extend/format-time.js +++ b/Sprint-2/5-stretch-extend/format-time.js @@ -1,6 +1,6 @@ // This is the latest solution to the problem from the prep. // Make sure to do the prep before you do the coursework -// +// // function formatAs12HourClock(time) { // const hours = Number(time.slice(0, 2)); // if (hours > 12) { @@ -33,8 +33,7 @@ // `current output: ${currentOutput4}, target output: ${targetOutput4}` // ) - -// This is my version +// This is my version function TimeAs12hours(time) { const hours = Number(time.slice(0, 2)); const minutes = time.slice(3); @@ -88,9 +87,9 @@ console.assert( `current time:${currentTime}, Target Time:${targetTime}` ); -currentTime=TimeAs12hours("12:00"); -targetTime="12:00 pm"; +currentTime = TimeAs12hours("12:00"); +targetTime = "12:00 pm"; console.assert( currentTime === targetTime, `current time:${currentTime}, Target Time:${targetTime}` -); \ No newline at end of file +);