“berisi () js” Kode Jawaban

JavaScript string berisi

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

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

String berisi javascirpt

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

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

JavaScript string berisi

var str = "We got a poop cleanup on isle 4.";
if(str.indexOf("poop") !== -1){
	alert("Not again");
}
//use indexOf (it returns position of substring or -1 if not found)
Grepper

JS String berisi

'Bandeira do Brasil'.includes('brasil'); // returns false
'Bandeira do Brasil'.includes('Brasil'); // returns true
GutoTrosla

berisi () js

const ParticipantsOfArtExhibition = [
	"Jhon",
  	"Amy",
  	"Liam"
]

ParticipantsOfArtExhibition.includes("Jhon") //true
ParticipantsOfArtExhibition.includes("Thompson") //false
ParticipantsOfArtExhibition.includes("Amy") //true
Red Team

JS String berisi

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

console.log(string.indexOf(substring) !== -1);
2 Programmers 1 Bug

Jawaban yang mirip dengan “berisi () js”

Pertanyaan yang mirip dengan “berisi () js”

Lebih banyak jawaban terkait untuk “berisi () js” di JavaScript

Jelajahi jawaban kode populer menurut bahasa

Jelajahi bahasa kode lainnya