Search
 
SCRIPT & CODE EXAMPLE
 

JAVASCRIPT

JavaScript Debugging

// js debugging exercises

// use const and let instead of var
const val1 = 69; // const for non changing values
let val2 = 420; // let for changing values

// use lots of console logs
console.log(val2, 't1')
/* manipulate val2 here */
console.log(val2, 't2')
// note: add some sort of string while console logging,
// so it becomes easy to find & remove logs when code is working

// use try...catch for catching errors
try {
  /* your code here */
} catch (err) {
  /* handle errors here */
  console.log(err, 'error')
}
Comment

JavaScript Debugging

<!DOCTYPE html>
<html>
<body>

<h1>My First Web Page</h1>

<script>
a = 5;
b = 6;
c = a + b;
console.log(c);
</script>

</body>
</html>
Comment

javascript debugging methods

console.log('Hello, I am writing to the console.');
Comment

PREVIOUS NEXT
Code Example
Javascript :: how array sort works internally in javascript 
Javascript :: check the constructor property to find out if an object is an Array (contains the word "Array"): 
Javascript :: how to send sendgrid email with dynamic template nodejs 
Javascript :: array destructuring mdn 
Javascript :: iterating hashmap angular 
Javascript :: how to get selected option attribute value in jquery 
Javascript :: https://stackoverflow.com/questions/51115640/how-to-send-form-data-from-react-to-express/51116082 
Javascript :: announcement for all server bot is in 
Javascript :: c# summary brackets 
Javascript :: javascript array group duplicates 
Javascript :: CELEBRITY PROBLEM gfg 7-18-21 
Javascript :: js datatables sort hidden columns 
Javascript :: javascript client side email 
Javascript :: session cookie vs persistent cookie 
Javascript :: find date range btween start date to end date in node js 
Javascript :: Upload literal unsupported graphql 
Javascript :: javascript loop all depths recursive object 
Javascript :: After installing a basic setup using above command, install below npm packages 
Javascript :: no unuseds varsnreactjs 
Javascript :: find js like 
Javascript :: Get value from ionRangeSlider in jquery 
Javascript :: how to convert base64 to webp in angular 
Javascript :: random number without rand function 
Javascript :: push array into another array at random positions javascript 
Javascript :: sort string array object javascript 
Javascript :: bookshelf log query 
Javascript :: input creates console log delay 
Javascript :: angularjs component stackoverflow 
Javascript :: generate diffrent random array Numbers 
Javascript :: js to jquery converter online 
ADD CONTENT
Topic
Content
Source link
Name
2+2 =