Problem List


Tickets
Search
Validate Form Data: Data Type
11a
Autogenerate a Username From an Email
11b
Reverse Messages for Chat Application
11c
Filter Spam Emails Using Keywords
11d
Analyze Composition of Text Blocks
11e
Process Weather Sensor Readings
12a
Validate Pathology Lab Results
12a
Data Reorganization for Real-Time Analytics
12b
Optimizing Inventory Management
12c
Ensuring Data Integrity in IoT Sensor Networks
12d
Streamlining Financial Data Consolidation for a Multi-National Corporation
12e
Real-Time Sports Performance Tracking
13a
Prevent Infinite Loops in a Warehouse Inventory Tracking System
13b
Optimizing Real-Time Sports Scores Display
13c
Real-Time Task Management System
13d
Integrating User Data from Two Social Media Platforms
13E
Designing an Undo/Redo Feature for a Text Editor
14a
Real-Time Code Editor with Syntax Validation
14b
Real-Time Calculator for Scientific Simulation Software
14c
Processing Palindromic Data in DNA Sequence Analysis
14d
Organizing Packages in a Warehouse Inventory System
14e
Customer Support Ticketing System
15a
Efficient Real-Time Traffic Monitoring System
15b
Undo Function in a Real-Time Collaborative Text Editor
15c
IoT Device Identification in a Smart Home System
15d
Optimizing Seating Arrangement for a Conference Event
15e
Real-Time Fraud Detection in E-Commerce Transactions
16a
Fraud Detection in Online Payment Systems
16b
Optimizing Search Results for an E-Commerce Platform
16c
Energy Consumption Monitoring in Smart Homes
16D
Detecting Engagement Loops in User Behavior
16e
Optimizing an E-commerce Website's Product Recommendation System
17A
Optimizing Cloud Storage for a Hierarchical Folder Structure
17B
Symmetric Network Topology Monitoring System
17C
Validate Form Data: Data Type
Level
DSA Concept
ID
11a
Difficulty
Scenerio
In a financial application, accurate handling of Social Security Numbers (SSNs) is critical. SSNs are used for identity verification, tax reporting, and various compliance-related processes. These numbers have a specific format: they are nine digits long, typically displayed as "XXX-XX-XXXX." Maintaining the integrity of this format is essential for proper data processing and validation.
A common issue arises when SSNs are treated as numerical data. When this happens, leading zeros are stripped away, and formatting dashes are removed, resulting in incorrect and unusable data. For example, the SSN "012-34-5678" could be transformed into the number 12345678, losing critical formatting information.
To prevent such errors, it is necessary to verify that SSN inputs are treated as strings, preserving their exact format. This verification should be part of a generalized data type verification function that can be reused across different parts of the application, ensuring robust data handling.
Description
Write a function that returns true if the inputted data is a string, or returns false if it is not a string
Example Uses
Input → Return
“Hello!” → true
123 → false
null → false
Directions
Make sure you have the repository set up on your local computer. If you need instructions on the initial set up you can find them here:
Once you are set up navigate to src > Beginner >String > 11a.mjs
Fill out the code to meet the requirements of the ticket.
To test the code run the following command: npm run test:grep -- @11a
Alternatively you can run the file by navigating into be beginner file in the terminal and running node 11a.mjs

Solution Requirements
The function returns true for regular strings (e.g., "Hello, World!")
The function returns true for numeric strings (e.g., "12345")
The function returns true for empty strings (e.g., "")
The function returns false for number data types (e.g., 12345)
The function returns false for null or undefined inputs
The function returns false for booleans (e.g., true or false)
The function returns false for other data types (e.g., arrays [], objects {})
Solution Explanation

Show hidden columns

Want to print your doc?
This is not the way.
Try clicking the ⋯ next to your doc name or using a keyboard shortcut (
CtrlP
) instead.