配列内のすべての文字列に対してjavascriptで自動部分文字列を作成することは可能ですか?例えば :javascript:配列内のすべての文字列に対してautomattic部分文字列を作成
var test =
[
"banana",
"apple",
"pear",
"cologne"
];
var conclusion = prompt("choose one")
// something that would get the following result:
if(conclusion === banana)
{
print("b");
print("ba");
print ("ban");
// ...
print("banana");
// and the same for the rest of the strings in the Array.
ループと文字列関数について説明します。 – SLaks
はい、可能です。 –