# js

* [Toolbox](#toolbox)
* [Frameworks](#frameworks)
* [UI](#ui)
* [Basic](#basic)
  * [text](#text)
  * [export & import](#export--import)
* [the default export can be imported with any name](#the-default-export-can-be-imported-with-any-name)
  * [this](#this)
  * [IIFE (Immediately Invokable Function Expression)](#iife-immediately-invokable-function-expression)
  * [Chrome Cross origin requests](#chrome-cross-origin-requests)
  * [pdf.js](#pdfjs)
* [JQuery](#jquery)
  * [events](#events)
* [JSX](#jsx)
* [MDX](#mdx)

## Toolbox

<https://bun.sh/>

```
powershell -c "irm bun.sh/install.ps1 | iex"
curl -fsSL https://bun.sh/install | bash
```

## Frameworks

* Vue: <https://nuxtjs.org/>
* React: <https://nextjs.org/>

## UI

* byCF: <https://kumo-ui.com/>

## Basic

### text

```
if ("ab"+"c".includes("bc")) { t="_3"; console.log(`t${t}`.replace(/\d/, "").length); } else if (true) {} else { } // Out: 2
```

### export & import

* <https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Statements/export>
* <https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Statements/import>

  ## the default export can be imported with any name

  export default k; // file test.js import anyName from "./test";

### this

<https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Operators/this>

```
const test = {
  prop: 42,
  func: function() {
    return this.prop;
  },
};
```

### IIFE (Immediately Invokable Function Expression)

```
(function() {
    statements
})();
```

### Chrome Cross origin requests

Cross origin requests are only supported for protocol schemes:\
http, data, chrome, chrome-extension, https.

### pdf.js

<https://github.com/mozilla/pdf.js/tree/master/examples/helloworld>

## JQuery

### events

<http://api.jquery.com/category/events/>

## JSX

an XML-like syntax extension to ECMAScript without any defined semantics: <https://facebook.github.io/jsx/> `const element = <h1>Hello, world!</h1>;`: <https://zh-hans.reactjs.org/docs/introducing-jsx.html>

## MDX

JSX + Markdown: <https://mdxjs.com/docs/what-is-mdx/>


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://book.ferro.pro/dev/js.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
