- Location - The location of the application. Usually just a URL, but the location can contain multiple pieces of information that can be used by an app
- pathname - The "file/directory" portion of the URL, like
invoices/123 - search - The stuff after
?in a URL like/assignments?showGrades=1. - query - A parsed version of search, usually an object but not a standard browser feature.
- hash - The
#portion of the URL. This is not available to servers inrequest.urlso its client only. By default it means which part of the page the user should be scrolled to, but developers use it for various things. - state - Object associated with a location. Think of it like a hidden URL query. It's state you want to keep with a specific location, but you don't want it to be visible in the URL.
- pathname - The "file/directory" portion of the URL, like
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| <?php | |
| namespace App\Shop\Base; | |
| use App\Shop\Base\Interfaces\BaseRepositoryInterface; | |
| use Illuminate\Database\Eloquent\Model; | |
| use Illuminate\Database\Eloquent\ModelNotFoundException; | |
| use Illuminate\Pagination\LengthAwarePaginator; | |
| /** |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| import { useState } from 'react'; | |
| export function useCounter(initial = 0) { | |
| const [count, setCount] = useState(initial); | |
| return [count, () => setCount(count + 1)]; | |
| } |
Answer: All APIs of Node.js library are aynchronous that is non-blocking. It essentially means a Node.js based server never waits for a API to return data. Server moves to next API after calling it and a notification mechanism of Events of Node.js helps server to get response from the previous API call.
Source: tutorialspoint.com
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| function omit(object, fields) { | |
| const shallowObject = Object.assign({}, object); | |
| if (typeof fields === Array) { | |
| fields.forEach(field => { | |
| if (!!shallowObject[field]) delete shallowObject[field]; | |
| }); | |
| return shallowObject; | |
| } else if (typeof fields === "string") return delete shallowObject[fields]; | |
| else throw new Error(`fields ${fields} must be array or string`); | |
| } |
OlderNewer