-
Notifications
You must be signed in to change notification settings - Fork 1
js Includes()
Altaskur edited this page Oct 5, 2022
·
3 revisions
Te permite saber si en un array, existe un determinado elemento. Devuelve como resultado un booleano.
array.includes(coincidencia);
`` let desayuno = ['café','tostada','fruta'];
let hayCafe = desayuno.includes('cafe');
hayCafe == true ? console.log("Hay café") ? console.log("Compra Café");
``