I have an object array where i'm trying to modify value if it starts with '//'. If the condition is met i want to add 'https:' before that. Then the value should be like 'https://'. I have done the following. Can't figure out where the problem is.
var projects = [
{
value: "//",
label: "jQuery",
desc: "the write less, do more, JavaScript library",
icon: "jquery_32x32.png"
},
{
value: "//",
label: "jQuery UI",
desc: "the official user interface library for jQuery",
icon: "jqueryui_32x32.png"
}];
const string1 = "https:";
const objIndex = projects.findIndex(obj => obj.value.indexOf('/') === 0 ? obj.value === string1.concat(obj.value): obj.value === obj.value );console.log(objIndex);