Try to find a judge in a small town
Note: the code implementation of this article uses JS (JavaScript) to provide problem-solving ideas for small partners who want to use js to practice algorithms and data structures in the front end.
describe
In a small town, number n people from 1 to n. It is rumored that one of these people is a secret judge in the town. If the town judge re ...
Posted by interpim on Sat, 18 Sep 2021 12:51:56 -0700
ES6 5. Extension of values
1 binary and octal representations
ES6 provides a new writing method, which is represented by prefixes 0b (or 0b) and 0o (or 0o) respectively.
0b11110111 === 503 // true
0o767 === 503 // true
Starting from ES5, in strict mode, octal values are no longer allowed to be represented by prefix 0. ES6 further clarifies that they are represent ...
Posted by unistake on Sat, 18 Sep 2021 05:39:32 -0700
LayUI framework quick start
LayUI overview
It is similar to Bootstrap, but the framework has a great advantage that it defines many style interfaces for front-end and back-end interaction, such as paging tables. It only needs to configure the interface at the front end, and the back end returns data according to the defined interface rules to complete the page display, w ...
Posted by larissahn on Sat, 18 Sep 2021 03:26:00 -0700
express implements the post interface (no parameter / normal / JSON / form data)
post interface without parameters
const express = require('express');
const app = express();
app.post('/api/post', function(req, res) {
// Direct return object
res.send({ name: 'abc' });
});
app.listen('8088', () => {
console.log('8088');
});
After starting the terminal, use postman to test the post interface~
I ...
Posted by stereo on Sat, 18 Sep 2021 01:49:19 -0700
Front end beginner's notes: JavaScript objects
JavaScript object
An object is a collection of related data and methods (usually composed of some variables and functions, which we call attributes and methods in an object)
1. Object creation
Literal mode
var obj = {
name:'TTTony',
age:21,
sayName:function(){
console.log(this.name);
}
}
Constructor Pattern
var obj = new Object(); ...
Posted by cyball on Fri, 17 Sep 2021 23:58:40 -0700
Sorting out JS video knowledge points [day02]
1. Type conversion
① How to convert to a string
//Three ways to convert strings
//null and undefined have no tostring() method
var num=1;
var str1=num.toString();
var str2=String(num); //'1' of string type
var s=1+'';
console.log(str1,str2,s);
② Convert other types to strings
var na=NaN;
var u=undefined;
var n=null;
var bool=true;
var arr ...
Posted by herve on Fri, 17 Sep 2021 21:03:21 -0700
JavaWEB notes 18 Vue components
JavaWEB notes 18 Vue components
1, Introduction to components:
Component: component-based development: each piece of the page is regarded as a separate part and assembled by the userComponentization: standard, divide and conquer, reuse, combinationVue implements partial component-based development at design time
Define global and local ...
Posted by ureck on Fri, 17 Sep 2021 14:49:55 -0700
This is the only super detailed explanation of Object object methods in JavaScript
In JavaScript, almost all objects are instances of object type, and they inherit properties and methods from Object.prototype. The object constructor creates an object wrapper for the given value. Object constructor, which creates an object based on the given parameters.
If the given value is null or undefined, an empty object is created a ...
Posted by forumnz on Fri, 17 Sep 2021 05:05:36 -0700
Vue Instance Initialization Option mix Initial Merge & Option Normalization Check
Vue Instance Initialization Option mix Initial Merge & Option Normalization Check (This 2005 word will take about 25-35 minutes)
1.Vue Instance Initialization Option mix initial merge (detailed merge will be mentioned in subsequent articles, if you need to view merge policy, please bypass the article-)
The merge is then mounted into the i ...
Posted by savio_mf on Fri, 17 Sep 2021 01:12:15 -0700
JS Data Type Detection
What are the methods for JS data type detection
What are the data types in JavaScript
In JavaScript, data types are divided into primitive and object types Raw data types include
String: Represents a string, for example:'jingzhi'Number: Represents a numeric value, for example, 123Boolean: Represents a Boolean type of data with two values tru ...
Posted by stupid girl! on Fri, 17 Sep 2021 00:17:52 -0700