mirror of
https://github.com/flipperdevices/flipperzero-firmware.git
synced 2025-12-13 13:29:50 +04:00
Documentation: new doc on Storage module and JS cleanup (#4161)
- Add new doc on Storage module - Improve formatting in the JS section for better readability
This commit is contained in:
@@ -1,49 +1,65 @@
|
||||
# Built-in methods {#js_builtin}
|
||||
|
||||
## require
|
||||
## require()
|
||||
Load a module plugin.
|
||||
|
||||
### Parameters
|
||||
**Parameters**
|
||||
- Module name
|
||||
|
||||
### Examples:
|
||||
**Examples**
|
||||
```js
|
||||
let serial = require("serial"); // Load "serial" module
|
||||
```
|
||||
|
||||
## delay
|
||||
### Parameters
|
||||
<br>
|
||||
|
||||
## delay()
|
||||
**Parameters**
|
||||
- Delay value in ms
|
||||
|
||||
### Examples:
|
||||
**Examples**
|
||||
```js
|
||||
delay(500); // Delay for 500ms
|
||||
```
|
||||
## print
|
||||
<br>
|
||||
|
||||
## print()
|
||||
Print a message on a screen console.
|
||||
|
||||
### Parameters
|
||||
**Parameters**
|
||||
The following argument types are supported:
|
||||
- String
|
||||
- Number
|
||||
- Bool
|
||||
- undefined
|
||||
|
||||
### Examples:
|
||||
**Examples**
|
||||
```js
|
||||
print("string1", "string2", 123);
|
||||
```
|
||||
<br>
|
||||
|
||||
## console.log
|
||||
## console.warn
|
||||
## console.error
|
||||
## console.debug
|
||||
## console.log()
|
||||
|
||||
<br>
|
||||
|
||||
## console.warn()
|
||||
|
||||
<br>
|
||||
|
||||
## console.error()
|
||||
|
||||
<br>
|
||||
|
||||
## console.debug()
|
||||
Same as `print`, but output to serial console only, with corresponding log level.
|
||||
|
||||
## to_string
|
||||
<br>
|
||||
|
||||
## to_string()
|
||||
Convert a number to string with an optional base.
|
||||
|
||||
### Examples:
|
||||
**Examples**
|
||||
```js
|
||||
to_string(123) // "123"
|
||||
to_string(123, 16) // "0x7b"
|
||||
|
||||
Reference in New Issue
Block a user