Your Submissions
You haven't submitted any code for this challenge yet. Solve the problem by passing all the test cases, and your submissions will appear here.
xxxxxxxxxx
44
var assert = require('assert');
console.log('Running and logging statements.');
function detectSubstring(str, subStr) {
// Fill in this method
return str;
}
console.log(detectSubstring('ggraph', 'graph'));
console.log(detectSubstring('geography', 'graph'));
console.log(detectSubstring('digginn', 'inn'));
try {
assert.equal(detectSubstring('thepigflewwow', 'flew'), 6);
console.log(
'PASSED: ' + "`detectSubstring('thepigflewwow', 'flew')` should return `6`"
);
} catch (err) {
console.log(err);
}
try {
assert.equal(detectSubstring('twocanplay', 'two'), 0);
console.log(
OUTPUT
Results will appear here.