Core JavaScript fundamentals including variables, data types, operators, control flow, and basic syntax. Essential foundation for all JavaScript development.
This Claude skill serves as a comprehensive technical reference for core JavaScript fundamentals, designed to anchor development in best practices. It covers essential syntax, data types, and control flow patterns while providing production-grade strategies for error handling and modern ES6+ implementation. By offering clear guidance on type coercion, logical operators, and troubleshooting, it helps developers write cleaner, more predictable code.
Use Cases
Syntax & Logic Reference: Quickly look up variable declarations, operator precedence, and complex control flow structures to ensure syntactical accuracy during development.
Code Quality Optimization: Implement professional patterns such as early returns, strict equality (===), and exhaustive switch statements to improve code readability and maintainability.
Debugging & Troubleshooting: Utilize the built-in error checklist to rapidly diagnose and resolve common JavaScript issues like ReferenceErrors, TypeErrors, and unexpected NaN results.
Modern Feature Integration: Safely adopt modern JavaScript operators like optional chaining (?.) and nullish coalescing (??) to handle null or undefined values more gracefully in production code.
name
fundamentals
description
Core JavaScript fundamentals including variables, data types, operators, control flow, and basic syntax. Essential foundation for all JavaScript development.
sasmp_version
"1.3.0"
bonded_agent
01-javascript-fundamentals
bond_type
PRIMARY_BOND
skill_type
reference
response_format
code_first
max_tokens
1500
required
[topic]
optional
[depth, examples]
on_ambiguity
ask_clarification
fallback
provide_basics_first
entry_log
"Fundamentals skill activated"
exit_log
"Fundamentals reference provided"
JavaScript Fundamentals Skill
Quick Reference Card
Variable Declaration
const PI = 3.14159; // Immutable binding (preferred)
let count = 0; // Reassignable
var legacy = "avoid"; // Function-scoped (avoid)
// Nullish coalescing
const name = input ?? 'Guest'; // Only null/undefined
// Optional chaining
const city = user?.address?.city; // Safe navigation
// Logical assignment
config.debug ??= false; // Assign if nullish
Troubleshooting
Common Issues
Error
Cause
Fix
ReferenceError: x is not defined
Variable not declared
Check spelling, scope
TypeError: Cannot read property
Accessing null/undefined
Use optional chaining ?.
NaN result
Invalid number operation
Validate input types
Unexpected true/false
Loose equality ==
Use strict ===
Debug Checklist
// 1. Check type
console.log(typeof variable);
// 2. Check value
console.log(JSON.stringify(variable));
// 3. Check for null/undefined
console.log(variable === null, variable === undefined);
// 4. Use debugger
debugger;
Production Patterns
Input Validation
function processNumber(value) {
if (typeof value !== 'number' || Number.isNaN(value)) {
throw new TypeError('Expected a valid number');
}
return value * 2;
}
Safe Property Access
const city = user?.address?.city ?? 'Unknown';
const callback = options.onComplete?.();