JavaScript Internals (521 Qs)•Part 3: DOM, Event Flow, Timers & Browser APIs (104 - 173)
Is there any relation between Java and JavaScript
No, they are entirely two different programming languages and have nothing to do with each other. But both of them are Object Oriented Programming languages and like many other languages, they follow similar syntax for basic features(if, else, for, switch, break, continue etc).
Practical Code Example
javascript
// Java and JavaScript have NO architectural relation:
// 'Java is to JavaScript as Car is to Carpet'
// JavaScript: Dynamic, prototype-based, interpreted/JIT, weakly typed
const jsObj = { role: 'Frontend' };
jsObj.newProp = 42; // Dynamic addition
// Java: Static, class-based, bytecode on JVM, strongly typed:
// public class User { private String role = "Backend"; }