Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

Add an endsWith method on String

This commit introduces a monkey patching to add a small but useful
method on String.
  • Loading branch information...
commit dfe378e980d9c5bb5a21c2a090918e0f2a7c1f6c 1 parent 09e78ac
@mchv authored
Showing with 8 additions and 0 deletions.
  1. +8 −0 public/js/editor/core.js
View
8 public/js/editor/core.js
@@ -1,5 +1,13 @@
var Solar = {};
+
+/** some useful monkey patching **/
+
+String.prototype.endsWith = function(suffix) {
+ return this.indexOf(suffix, this.length - suffix.length) !== -1;
+};
+
+
/** Some utils **/
Solar.Utils = {
Please sign in to comment.
Something went wrong with that request. Please try again.