A collection of JavaScript practice programs covering core concepts, operators, built-in objects, and common algorithms.
| Topic | File | Concepts |
|---|---|---|
| Strings | String.js |
String methods, template literals, palindrome, vowel/consonant counting, word count, reverse string |
| Numbers & Math | Number_Math.js |
Number methods, Math object, random number generation, OTP generator, time conversion, swapping |
| Comparison & Logical | comparison_logical.js |
if-else, ternary operator, logical operators (&&, ||), leap year, grade system, triangle validation, password strength |
| Date & Time | date_time.js |
Date object, getFullYear, getMonth, getDate, getDay, getHours, getMinutes, getSeconds |
Run any file with Node.js:
node String.js
node Number_Math.js
node comparison_logical.js
node date_time.jsMost code examples are commented out. Uncomment the section you want to test and run the file.
- Node.js (v12 or higher)