showing results for - "typeerror"
Malcolm
01 Sep 2020
1try {
2  throw new TypeError('Hello', "someFile.js", 10)
3} catch (e) {
4  console.log(e instanceof TypeError)  // true
5  console.log(e.message)               // "Hello"
6  console.log(e.name)                  // "TypeError"
7  console.log(e.fileName)              // "someFile.js"
8  console.log(e.lineNumber)            // 10
9  console.log(e.columnNumber)          // 0
10  console.log(e.stack)                 // "@Scratchpad/2:2:9\n"
11}
Antoine
18 Mar 2016
1try {
2  null.f()
3} catch (e) {
4  console.log(e instanceof TypeError)  
5  console.log(e.message)               
6  console.log(e.name)                  
7  console.log(e.fileName)              
8  console.log(e.lineNumber)            
9  console.log(e.columnNumber)          
10  console.log(e.stack)                 
11}
Vincenzo
30 Sep 2020
1//Occurs when trying to use a value in an invalid way.
2
31();
4
5/*The numeric value 1 is not a function, so trying to use it as one 
6results in TypeError: 1 is not a function.*/
Juan Sebastián
01 Aug 2019
1try {
2  null.f()
3} catch (e) {
4  console.log(e instanceof TypeError)  
5  console.log(e.message)               
6  console.log(e.name)                  
7  console.log(e.fileName)              
8  console.log(e.lineNumber)            
9  console.log(e.columnNumber)          
10  console.log(e.stack)                 
11}
120
13
similar questions
queries leading to this page
typeerror