[Finishes #106352136] String contains#4784
Conversation
There was a problem hiding this comment.
Note, most of these changes are getting rid of quotes around modeOptionName
|
This seems like a pretty big departure from our strategy up to this point, which was to only expose methods on classes which actually have that method in Javascript (ES5). Can you give me some background on this decision? |
|
I agree, and expressed my apprehensiveness about monkey patching String.prototype. Basically, the ed team thinks that teaching indexOf() !== -1 right away is more confusing than they would like. I suggested possibly doing something like contains(string, substring), but that's also weird since we do have a bunch of other methods on String.prototype that we teach. After discussing some we Sarah, we decided that the benefits (easier for students) outweighed the fact that we're now teaching stuff that won't work in native JS. If you feel strongly about this, you can try to convince her otherwise :) |
|
Will update to use String.prototype.includes instead https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String/includes |
|
@davidsbailey could you take a look now that we're using includes? |
|
LGTM |
[Finishes #106352136] String contains
Add String.prototype.contains to applab
Add some tests for this and our other string functions