Home > Web Front-end > JS Tutorial > body text

Video tutorial on how to learn javascript while talking and laughing

黄舟
Release: 2017-08-30 09:49:56
Original
967 people have browsed it

JavaScript is a literal scripting language. It is a dynamically typed, weakly typed, prototype-based language with built-in support for types. Its interpreter is called the JavaScript engine, which is part of the browser and is widely used in client-side scripting languages. Through this tutorial, we will learn the use of JavaScript in depth.

Video tutorial on how to learn javascript while talking and laughing

Course playback address: http://www.php.cn/course/203.html

The teacher’s teaching style:

The teacher’s lectures are simple, clear, layer-by-layer analysis, interlocking, rigorous argumentation, rigorous structure, using the logical power of thinking to attract people Students' attention and rational control of the classroom teaching process. By listening to teachers' lectures, students not only learn knowledge, but also receive thinking training, and are also influenced and influenced by teachers' rigorous academic attitude.

The more difficult point in this video is the javascript operation object:

<script type="text/javascript" >	/**
	*对象声明和赋值操作
	*
	**/
  	var empty={} //空对象声明
	var point ={x:0,y:0}; //声明并直接赋值
	var circle={x:point,y:point.y+1,randis:2}; //声明赋值	
	//复杂对象声明并赋值
	var home={		"
name":"Home simpson",		
"age":34,		
"married":true,		
"occupation":"plant operation",		
"email":"linfeng@google.com"
		
		}	//数组对象声明
	var array=new Array();	
array[0]="hello\t";	
array[1]="world\t";	array[2]="javascript\t";	
/**
	* for in 方法 遍历数组
	**/
	function foreach(){		
var names="";		
for( var name in  array)
		{
			alert(array[name]);	
			names+=name+"\n";			
//alert(names);	
		}
	}	/**
	* join("分隔符"):返回用分隔符分隔的新数组
	*
	**/
	function array_join(){		   
var joinarray=array.join(",");
		   alert(joinarray);
		
	}	/**
	*reverse():返回翻转后的数组
	*
	*/
	function array_reverse(){		
var reversearray= array.reverse();
		alert(reversearray);
	}		/**
		* sort():返回排序后的数组
		*
		*/
	function array_sort(){	       
var reversesort= array.sort();
	   alert(reversesort);
	}		var array_add=new Array("add element");	
/**
	* concat():将一个新数组展开与原数组合并,返回新数组
	*
	*/
	function array_concat(){		
var new_array=array.concat(array_add);
		alert(new_array);
	}		/**
		*slice(数组下标,影响个数) :返回数组片段
		*
		*/	
	  function array_slice(){		  
array.concat(array_add);		  
var slice_array=array.slice(0,2);
		  alert(slice_array);//
		  }	
/**
         *splice(数组下标,影响元素个数0/1,....,插入数据1,....):删除指定位置 指定个数的元素
         *return 返回影响后的新数组 (如果影响个数为0,则在下标位置插入参数3--N对应的元素)
	 *备注:和concat不同,插入的数组不会展开,而是作为一个元素插入
         **/
	function array_splice(){		
		var a=[1,2,3,4,5,6,7,8];		
//a.splice(4);
		//a.splice(2,3); a=[1,2,6,7,8]
		//a.splice(2,0,&#39;a&#39;,&#39;b&#39;); //a=[1,2,a,b,3,4,5,6,7,8]
		a.splice(3,0,&#39;abc&#39;);//a=[1,2,abc,3,4,5,6,7,8]
		alert(a);
		
		}		/**
		* push():从栈底插入一个或多个对象,返回数组的新长度
		* pop():从栈底删除一个对象,数组长度-1,返回它删除的值
		* 备注:push和pop不是生成新数组,而是在原来数组的基础上加入和删除元素
		*
		**/
		function push_pop(){			var stack=[];
			stack.push(1,2);
			alert(stack);
			stack.pop();
			alert(stack);
			stack.push(3);
			alert(stack);
			stack.pop();
			stack.push([4,5]);
			alert(stack);
              }		/**
		*unshift():从栈顶插入一个或几个对象,原数组元素向下移动,返回数组新长度
		*shift():从栈顶删除一个元素,其他元素向上补充,返回删除的元素值
		*备注:unshift和shift不是生成新数组,而是在原来数组的基础上加入和删除元素
		*    插入的数组顺序刚好和原数组顺序相反
		*/
		function unshift_shift(){			var stack=[];
			stack.unshift(1);
			stack.unshift(2);
			
			alert(stack.shift());
			alert(stack);

			alert(stack.unshift(3,[ab]));			//stack.shift();
			//alert(stack);
			//stack.shift();
			//alert(stack);
		}
</script>
Copy after login

Here we also recommend downloading source code resources: http:/ /www.php.cn/xiazai/code/2133

The resources share video courseware and source code

The above is the detailed content of Video tutorial on how to learn javascript while talking and laughing. For more information, please follow other related articles on the PHP Chinese website!

Related labels:
source:php.cn
Statement of this Website
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template