|
@@ -31,7 +31,6 @@
|
|
|
|
|
|
//Multiply table
|
|
//Multiply table
|
|
{
|
|
{
|
|
- //const arr = [[],[0,1,2,3,4,5,6,7,8,9,10],[0,2,4,6,8,10,12,14,16,18,20],[0,3,6,9,12,15,18,21,24,27,30],[0,4,8,12,16,20,24,28,32,36,40],[0,5,10,15,20,25,30,35,40,45,50]]
|
|
|
|
const arr = [[0,0,0,0,0],[0,1,2,3,4],[0,2,4,6,8],[0,3,6,9,12],[0,4,8,12,16]]
|
|
const arr = [[0,0,0,0,0],[0,1,2,3,4],[0,2,4,6,8],[0,3,6,9,12],[0,4,8,12,16]]
|
|
console.log(arr[3][4])// ответ 12
|
|
console.log(arr[3][4])// ответ 12
|
|
}
|
|
}
|
|
@@ -178,12 +177,13 @@
|
|
const currencies = ["USD", "EUR", "GBP", "UAH"]
|
|
const currencies = ["USD", "EUR", "GBP", "UAH"]
|
|
let str = "<table border='1'>"
|
|
let str = "<table border='1'>"
|
|
for (let currency of currencies){
|
|
for (let currency of currencies){
|
|
- str += '<tr>'+currency+'</tr>'
|
|
|
|
|
|
+ str += '<tr>'
|
|
console.log(currency)
|
|
console.log(currency)
|
|
for (let letter of currency){
|
|
for (let letter of currency){
|
|
str += '<td>'+letter+'</td>'
|
|
str += '<td>'+letter+'</td>'
|
|
console.log(letter)
|
|
console.log(letter)
|
|
}
|
|
}
|
|
|
|
+ str += '</tr>'
|
|
}
|
|
}
|
|
str+= "</table>"
|
|
str+= "</table>"
|
|
document.write(str)
|
|
document.write(str)
|
|
@@ -193,14 +193,12 @@
|
|
{
|
|
{
|
|
const arr = [[0,0,0,0,0],[0,1,2,3,4],[0,2,4,6,8],[0,3,6,9,12],[0,4,8,12,16]]
|
|
const arr = [[0,0,0,0,0],[0,1,2,3,4],[0,2,4,6,8],[0,3,6,9,12],[0,4,8,12,16]]
|
|
let str = "<table border='1'>"
|
|
let str = "<table border='1'>"
|
|
- let i = 0
|
|
|
|
for (let currency of arr){
|
|
for (let currency of arr){
|
|
- str += '<tr>'+currency+'</tr>'
|
|
|
|
- console.log(currency)
|
|
|
|
|
|
+ str += '<tr>'
|
|
for (let letter of currency){
|
|
for (let letter of currency){
|
|
str += '<td>'+letter+'</td>'
|
|
str += '<td>'+letter+'</td>'
|
|
- console.log(letter)
|
|
|
|
}
|
|
}
|
|
|
|
+ str+= '</tr>'
|
|
}
|
|
}
|
|
str+= "</table>"
|
|
str+= "</table>"
|
|
document.write(str)
|
|
document.write(str)
|
|
@@ -228,11 +226,16 @@
|
|
alert(arr)
|
|
alert(arr)
|
|
}
|
|
}
|
|
|
|
|
|
|
|
+
|
|
//Beep Lexics
|
|
//Beep Lexics
|
|
{
|
|
{
|
|
- const motherWord = ['дурак']
|
|
|
|
- const arr = prompt('Введите строку').split(' ')
|
|
|
|
- let resultArr = arr.map(x => x===motherWord[0] ?x='BEEP':x=x).join(' ')//понимаю что это не решение, но ничего другого не придумал
|
|
|
|
|
|
+ const arr = ['бляха', 'муха', "пляха", "шабля"]
|
|
|
|
+ let motherWord = prompt('Введите строку').split(' ')
|
|
|
|
+ let arr2 = []
|
|
|
|
+ for (let el of arr){
|
|
|
|
+ motherWord = motherWord.map(x => x===el ?x='BEEP':x)
|
|
|
|
+ }
|
|
|
|
+ alert(motherWord.join(' '))
|
|
}
|
|
}
|
|
|
|
|
|
|
|
|