JavaScript Essentials
Variables (let/const/var), types, closures, this, arrow functions, destructuring, spread/rest
1What is the main difference between let and var in JavaScript?
What is the main difference between let and var in JavaScript?
Antwort
let has block scope while var has function scope. This means a variable declared with let is only accessible within the block where it's defined (between curly braces), whereas var is accessible throughout the entire function. This difference is crucial to avoid bugs related to hoisting and variables leaking outside their intended context.
2What happens when accessing a let variable before its declaration?
What happens when accessing a let variable before its declaration?
Antwort
A ReferenceError is thrown because the variable is in the Temporal Dead Zone (TDZ). Unlike var which is hoisted with undefined value, let variables are hoisted but remain inaccessible until their declaration. This temporal dead zone helps detect programming errors where a variable is used before being defined.
3What is the main characteristic of const in JavaScript?
What is the main characteristic of const in JavaScript?
Antwort
const prevents reference reassignment but not content mutation. For primitive types, this means the value cannot change. For objects and arrays, the reference stays the same but properties or elements can be modified. Using const by default is good practice as it expresses the intent not to reassign the variable.
What are the primitive types in JavaScript?
What is the result of typeof null in JavaScript?
+22 Interview-Fragen
Weitere React Native-Interviewthemen
React Fundamentals
React Native Basics
React Hooks
TypeScript for React & React Native
React Native Components & API
React Native Styling & Layout
React Native Navigation
React Native State Management
React Native Networking & API
Data Persistence
Forms & Validation
React Native Animations
Native Modules & Bridge
Platform-Specific Code
Permissions & Device APIs
Push Notifications
React Native Testing
React Native Debugging
Build & Deployment
Expo vs React Native Bare
Performance Optimization
Memory Management
Architecture Patterns
React Native New Architecture
Security Best Practices
Offline-First Architecture
React Native CI/CD
Monorepo & Code Sharing
Advanced Topics
App Lifecycle & Background Execution
Authentication & Session Management
Monitoring & Crash Reporting
Meistere React Native für dein nächstes Interview
Zugang zu allen Fragen, Flashcards, technischen Tests, Code-Review-Übungen und Interview-Simulatoren.
Kostenlos starten