Skip to content

Thiravidaselvam/JavaQuery

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

20 Commits
 
 

Repository files navigation

Scope functions-JavaQuery

basics of java query functions

Differend type of scope

const name='I am trying to develope React function'
function print () 
{
	const name='it is called from function scope'
	console.log(name)
	if (true)
	{
	const name='it is called from block scope'
	console.log(name)
	}
}
console.log(name)
print()
	

Variable Scope function

 function print()
 {
 	if (true)
  	{
   	var name='Test value of variable scope'
    	}
 }  
 print()
 console.log(var)

above code name was declared in if block , if condition true then we can call name other wise create undefined error so it is called variable scope

Hoisting variable

	function hoistcode()
	{
		a=10;
		let b=15;
	}
	hoistcode();
	console.log(a) // 10
	console.log(b) // undefined issue

above a has declared within the block java has consider non declared varaible as var type so we can call out side of the function. let variable only we can use in the block error code: VM137:8 Uncaught ReferenceError: b is not defined at :8:14. it is called hoisting.

About

basics of java query functions

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published