fill(填充數據,位置開始,結束)
const array1 = [1, 2, 3, 4]; //從位置 2 到位置 4 填充 0 console.log(array1.fill(0, 2, 4)); //[1,2,0,0] //從位置 1 填充 5 console.log(array1.fill(5, 1)); //[1,5,5,5] //填充6 console.log(array1.fill(6)); // [6, 6, 6, 6]
1 | flex-flow: flex-direction flex-wrap; |
#flex-start:起點
#flex-end:終點
#center:置中
#space-between::是平均分配「元素」位置,但左右兩側會貼齊主軸的起點、終點
#space-around:是平均分配「元素」位置,但左右兩側的間距會較小 | Space-evenly是「元素」和「左右兩側」的間距皆相同;
設置對像是行內成員,該屬性可以控制彈性容器中成員在當前行內的對齊方式。當成員設置了align-self 屬性時,父容器的 align-items 值則不再對它生效;行內成員會在其邊界盒正交軸上被居中(如果行正交尺寸小於行內成員尺寸,行內成員將會在正交軸兩方向等量溢出)
所有行被集中(擠)在彈性容器(正交軸)中間。它們彼此之間齊平,並且跟彈性盒子正交起始邊界的空白與跟彈性盒子正交結束邊界的空白相等。 (如果溢出空白為負數,所有行將會在正交軸兩方向等量溢出)鏈接。 )
#flex
1 | flex:flex-grow | flex-shrink | flex-basis |
1 | flex-grow: number; |
1 | flex-basis: number|auto|initial|inherit; |
const stringObj = new String('foo');
const newObj=stringObj.toString();
console.log(newObj)
//"foo"
const sentence = 'The quick brown fox jumps over the lazy dog.'; console.log(sentence.toLowerCase()); //the quick brown fox jumps over the lazy dog.
const sentences = 'The is apple.'; console.log(sentences.toUpperCase()); //"THE IS APPLE."
const greeting = ' Hello world! '; const greetingTrim=greeting.trim(); console.log(greetingTrim); //Hello world!"
const greetTrimEnd=greeting.trimEnd();
console.log('清除結束的空白',greetTrimEnd)
//"清除結束的空白" " Hello world!"
greenTrimStart=greeting.trimStart();;console.log(‘清除開始的空白’,greenTrimStart)
//“清除開始的空白” “Hello world! “