-
Notifications
You must be signed in to change notification settings - Fork 686
Добавляет информацию в статью о DataView #5888
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
Conversation
// true или false | ||
``` | ||
|
||
Обратите внимание, по умолчанию `DataView` использует именно big-endian, однако многие платформы используют little-endian. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Давай перечислим тут в скобочках несколько этих платформ. Если не ошибаюсь, то они и есть самые часто используемые: Windows, Linux, macOs.
```js | ||
const littleEndian = (() => { | ||
const buffer = new ArrayBuffer(2); | ||
new DataView(buffer).setInt16(0, 256, true); | ||
|
||
return new Int16Array(buffer)[0] === 256; | ||
})(); | ||
|
||
console.log(littleEndian); | ||
// true или false |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
А в каком случае тут будет false
? Было бы здорово чуть подробнее это описать.
@marss-hub Привет! |
Превью контента из 660fcb4 опубликовано. |
Описание
Дополняю статью о
DataView
Closes #4793
Чек-лист
/css/color/
,/tools/json/
,/tools/gulp/#kak-ponyat
)images/example.png
,demos/example/
,../demos/example/
)