“string berisi js” Kode Jawaban

Periksa JavaScript Substring

const string = "javascript";
const substring = "script";

console.log(string.includes(substring));  //true
Batman

JavaScript string berisi

var string = "foo",
    substring = "oo";

console.log(string.includes(substring));
Cautious Crane

string sudut berisi

const string = "foo";
const substring = "oo";

console.log(string.includes(substring));
2 Programmers 1 Bug

JavaScript string berisi


function longestString() {
 var longest = ' ';
for (var i=0; i < arguments.length; i++) {
  if(arguments[i].length > longest.length) {
    longest = arguments[i];
  }
}
return longest;
 

}

console.log(longestString("asda", "asdasdasd", "12311","akjsdgkjagsdkjagkjdgkajsgdkjas"));
Raymund Alum

string javascript berisi fungsi

s = "Hello world";
console.log(s.includes("world"));
Curious Cormorant

string berisi js

var str = "foobar"
var regex = /foo/g;
if (str.search(regex) !== -1) {
  alert("string conains foo!")
}
waves

Jawaban yang mirip dengan “string berisi js”

Pertanyaan yang mirip dengan “string berisi js”

Lebih banyak jawaban terkait untuk “string berisi js” di JavaScript

Jelajahi jawaban kode populer menurut bahasa

Jelajahi bahasa kode lainnya