Skip to content

Conversation

@Smita81
Copy link
Collaborator

@Smita81 Smita81 commented May 6, 2024

No description provided.

@Smita81 Smita81 requested a review from dannyelcf May 6, 2024 12:30
@Smita81 Smita81 self-assigned this May 6, 2024
@@ -1,4 +1,9 @@
document.getElementById('user-action').addEventListener('click', (event) => {
import { TYPE_USER_ACTION, TYPE_CASTED_VALUE } from "../data/constants";
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

You must import listener.js here.

import './listener.js'

Comment on lines 11 to 20
let newValue;
if (intendedType === 'string') {
newValue = String(stringToCast);
} else if (intendedType === 'number') {
newValue = Number(stringToCast);
} else if (intendedType === 'boolean') {
newValue = Boolean(stringToCast);
} else {
newValue = undefined;
}
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Invoke the function typeCaster here.

Ex:

const newValue  = typeCaster(stringToCast, intendedType)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants