# JavaScript Essentials

> The JavaScript you need for React Native: values, functions, objects, arrays, modules and modern syntax. Free notes, key concepts, resources and a mini project.

Canonical: https://www.internhack.in/roadmaps/tracks/mobile/javascript-basics
Last updated: 2026-11-28

The JavaScript you need for React Native: values, functions, objects, arrays, modules and modern syntax.

Beginner · about 12 hours · difficulty 2/5

If you chose React Native, JavaScript is the ground you stand on. You do not need browser DOM knowledge, but you do need the language itself to feel natural.

### What to learn

- **Values and types**: strings, numbers, booleans, `null`, `undefined`, objects and arrays. Understand equality (`===`) and truthiness.
- **Variables**: `const` by default, `let` when reassigning; avoid `var`.
- **Functions**: declarations, arrow functions, default parameters, closures.
- **Objects and arrays**: destructuring, spread (`...`), and array methods `map`, `filter`, `reduce`, `find`. React code uses these constantly to render lists and update state immutably.
- **Modules**: `import` and `export`, named vs default exports.
- **Error handling**: `try/catch`, throwing errors.

### Pitfalls

- Mutating arrays or objects in place (`push`, direct assignment) causes React state bugs; create new copies instead.
- `this` behaves differently in arrow functions; modern React code rarely needs `this` at all.

**Good enough to move on:** you can take an array of product objects and produce a filtered, sorted list of names without mutating the original, and explain closures with an example.

## Key concepts

- **Types, equality and truthiness**
- **const, let and scope**
- **Functions, arrow functions and closures**
- **Destructuring and spread**
- **Array methods: map, filter, reduce**
- **ES modules**
- **Immutability patterns**
- **Classes and prototypes**

## Mini project

Write a small Node script that loads a JSON list of expenses, groups them by category with reduce, and prints totals sorted from highest to lowest.

## Check yourself

Why does calling push() on an array held in React state often fail to update the UI?

## Free resources

- [MDN JavaScript Guide](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Guide) (MDN)
- [The Modern JavaScript Tutorial](https://javascript.info/) (javascript.info)

Previous: [Native iOS (Swift + SwiftUI)](https://www.internhack.in/roadmaps/tracks/mobile/native-ios) · Next: [TypeScript for App Code](https://www.internhack.in/roadmaps/tracks/mobile/typescript)

## More in Language Foundations

- [JavaScript Essentials](https://www.internhack.in/roadmaps/tracks/mobile/javascript-basics)
- [TypeScript for App Code](https://www.internhack.in/roadmaps/tracks/mobile/typescript)
- [Dart Essentials](https://www.internhack.in/roadmaps/tracks/mobile/dart)
- [Kotlin Essentials](https://www.internhack.in/roadmaps/tracks/mobile/kotlin)
- [Swift Essentials](https://www.internhack.in/roadmaps/tracks/mobile/swift)
- [Async Code & the Main Thread](https://www.internhack.in/roadmaps/tracks/mobile/async-programming)

## Related

- [Roadmaps](https://www.internhack.in/roadmaps)
- [Mobile App Developer Roadmap](https://www.internhack.in/roadmaps/tracks/mobile)
