One of the things that I have noticed about bitwise operations in JavaScript is that it can be convenient for smaller values, but doesn’t always work for larger values. The reason this is the case is because bitwise operators will only work fully for operands which can be fully expressed in a 32-bit signed format. In other words, using bitwise operations will only produce numbers that are in the range of -2147483648 (-231) to 2147483647 (231 – 1). In addition, if one of the operands used is outside of that range, the last 32 bits of the number will be used instead of the specified number. Therefore, in order to represent a terabyte in JavaScript while using the left shift operator (<<), you would need to do something like the following: [code language="javascript"] (1 << 30) * (1 << 10) // same as Math.pow(2, 40) [/code] If you are not familiar with bitwise operators in JavaScript, I suggest taking a look at this page from Mozilla’s Developer Network.
Blog
Salesforce LWC – Controlling Height of Datatables
At times you may want to set a minimum height and/or a maximum height for an Lightning Web Component Datatable. The documentation may lead you to believe that you cannot accomplish this but with some Read more…