问题描述
我正在尝试创建一个表视图,用户可以在其中将信息输入到文本视图中。到目前为止,我的代码允许文本视图的高度根据用户输入的长度而扩展。但是,表格单元格的高度并没有增加-保持不变。我已经浏览了堆栈溢出,但是所提出的解决方案似乎都不起作用。如果有人有任何建议,将不胜感激。非常感谢:)
const myArr = [3,4,8,2,1];
function adjacentElementsProduct(arr) {
return Math.max(...arr.slice(1).map((x,i) => [x * arr[i]]))
// 1. Creates new array - [4,1] using arr.slice(1)
// 2. uses map over array to iterate over all elements of newly created array
// 3. map returns an array which is array containing product of adjacent element of original array
// 4. The array will be expanded into arguments using spread operator
// 5. Math.max will return the maximum of all these arguments (which are just the multiplication of all adjacent elements of our original array)
}
console.log(adjacentElementsProduct(myArr))
解决方法
暂无找到可以解决该程序问题的有效方法,小编努力寻找整理中!
如果你已经找到好的解决方法,欢迎将解决方案带上本链接一起发送给小编。
小编邮箱:dio#foxmail.com (将#修改为@)