Search
 
SCRIPT & CODE EXAMPLE
 

JAVASCRIPT

javascript string error

Error.prototype.toString = function() {
  'use strict';

  var obj = Object(this);
  if (obj !== this) {
    throw new TypeError();
  }

  var name = this.name;
  name = (name === undefined) ? 'Error' : String(name);

  var msg = this.message;
  msg = (msg === undefined) ? '' : String(msg);

  if (name === '') {
    return msg;
  }
  if (msg === '') {
    return name;
  }

  return name + ': ' + msg;
};
Comment

PREVIOUS NEXT
Code Example
Javascript :: create multiple images in js 
Javascript :: function prototype javascript 
Javascript :: sliding element jquery 
Javascript :: npm react-device-detect 
Javascript :: regex match first result only 
Javascript :: how to create component in reactjs 
Javascript :: node cron schedule specific time 
Javascript :: javascript how to remove first element of array 
Javascript :: js format indian price with commas 
Javascript :: javascript save data to local storage 
Javascript :: vue js get routes 
Javascript :: performing query with sequelize includes 
Javascript :: vscode add shortcut to run in terminal 
Javascript :: js origin without port 
Javascript :: what are closures 
Javascript :: run javascript in iframe 
Javascript :: Generate a Random Integer 
Javascript :: js push array 
Javascript :: html form data to json 
Javascript :: javascript Arrow Function with One Argumen 
Javascript :: clone array 
Javascript :: array length in javascript 
Javascript :: How to return arguments in an array in javascript 
Javascript :: change inptu val 
Javascript :: componentdidmount in functional component 
Javascript :: target child event 
Javascript :: remove object from array of object 
Javascript :: react native api call 
Javascript :: animate change background color angular 
Javascript :: reverse string in javascript 
ADD CONTENT
Topic
Content
Source link
Name
3+4 =