What it can make
- Write new code
- Find and fix a bug
- Explain code
- Refactor code
- Write documentation
What you tell it
- Task: choose from 5 options
- Language or framework (optional)
- Describe it or paste code
See it work
You write
A TypeScript function that checks whether a string is a valid Indian PIN code
You get
/**
* Validates if a given string is a valid Indian PIN code.
* Criteria:
* - Must be exactly 6 digits long.
* - Must not start with '0'.
*
* @param pinCode - The string to validate.
* @returns True if valid, false otherwise.
*/
export const isValidIndianPIN = (pinCode: string): boolean => {
const pinRegex = /^[1-9][0-9]{5}$/;
return pinRegex.test(pinCode);
};Try one of these
What it costs
3 to 8 credits per result, shown before you start. Exactly that is taken from your balance when the result is made, and a failed generation is refunded in full. See Credits for how they work.
More tools like this
AI results can contain mistakes. Check anything that matters before you use it.