JSFiddle - React, Tailwind, and code Playground
HTML
<h1 id="title">BugBlog: JavaScript example zu && vs &</h1>
<input type="submit" id="byBtn" value="Change" onclick="change()"/>
JavaScript
function Hello(){
alert("Hello");
return FALSE;
}
function World(){
alert("World");
return FALSE;
}
function change(){
alert("Mit einem & -> ");
if(Hello() & World()){
alert("!");
}else{
alert("?");
}
alert("Mit zwei & -> ");
if(Hello() && World()){
alert("!");
}else{
alert("?");
}
}