Basic packaging types

Time:2021-2-23

Basic wrapper type is to wrap simple data type into complex data type.

var str = ‘andy’;

console.log(str.length);

Only objects and complex data types have attributes and methods. Why is there a length attribute?

The process is as follows

Var temp = new string (‘andy ‘); / / wrapped as complex data type

STR = temp; / / give the value of the temporary variable to str

Temp = null; / / the temporary variable will be destroyed automatically

Recommended Today

Rust programming video tutorial (Advanced) – 024_ 3 syntax of all modes 3

Video address Headline address:https://www.ixigua.com/i677586170644791348…Station B address:https://www.bilibili.com/video/av81202308/ Source address GitHub address:https://github.com/anonymousGiga/learn_rus… Explanation content 1. Ignore values in mode(1) Use_ Ignore entire valueexample: fn foo(_: i32, y: i32) { println!(“This code only uses the y parameter: {}”, y); } fn main() { foo(3, 4); } Note: placeholders are used for parameters in the function, mainly when implementing […]