Pen Settings

HTML

CSS

CSS Base

Vendor Prefixing

Add External Stylesheets/Pens

Any URLs added here will be added as <link>s in order, and before the CSS in the editor. You can use the CSS from another Pen by using its URL and the proper URL extension.

+ add another resource

JavaScript

Babel includes JSX processing.

Add External Scripts/Pens

Any URL's added here will be added as <script>s in order, and run before the JavaScript in the editor. You can use the URL of any other Pen and it will include the JavaScript from that Pen.

+ add another resource

Packages

Add Packages

Search for and use JavaScript packages from npm here. By selecting a package, an import statement will be added to the top of the JavaScript editor for this package.

Behavior

Save Automatically?

If active, Pens will autosave every 30 seconds after being saved once.

Auto-Updating Preview

If enabled, the preview panel updates automatically as you code. If disabled, use the "Run" button to update.

Format on Save

If enabled, your code will be formatted when you actively save your Pen. Note: your code becomes un-folded during formatting.

Editor Settings

Code Indentation

Want to change your Syntax Highlighting theme, Fonts and more?

Visit your global Editor Settings.

HTML

              
                
              
            
!

CSS

              
                
              
            
!

JS

              
                	const human3 = {
			name:'Sacha',
			vave:5000,
			humen2:{
				firstName:'Sveta',
				LastName:'Ivanova'
			}
		};
		console.log(human3.humen2.firstName);//sveta,
		console.log(human3['humen2']['firstName']);//sveta,

		пример
		js6
		let name55 = 'Вася';
		let isAdmin = true;
		const user55 = {
			name55,
			isAdmin
		};
		console.log(user55.name55);//Вася

		// js5
		let name55 = 'Вася';
		let isAdmin = true;
		const user55 = {
			name:name55,
			isAdmin
		};
		console.log(user55.name);//Вася
		console.log(user55);//{name: "Вася", isAdmin: true}

добавим мссив 

		let name55 = 'Вася';
		let isAdmin = true;
		let isArr = [4,5,6,7];
		const user55 = {
			name:name55,
			isAdmin,
			isArr,
			
		};
		
		console.log(user55);//{name: "Вася", isAdmin: true}
		                   // {name: "Вася", isAdmin: true, isArr: Array(4)}
		console.log(user55.isArr);//[4, 5, 6, 7]

		создадим еще одну текстовую переменную "firstName" в имени объекта propName итойзаписи [propName]:"JohDou"

		let name55 = 'Вася';
		let isAdmin = true;
		let isArr = [4,5,6,7];
		let propName = "firstName"
		const user55 = {
			name:name55,
			isAdmin,
			isArr,
			[propName]:"jon Dou"
		};
		
		console.log(user55.firstName);//"jon Dou"

		добавим переменные let a="мой" let b="зеленый"let c="кракодил"

		let name55 = 'Вася';
		let isAdmin = true;
		let isArr = [4,5,6,7];
		let propName = "firstName"
		let a="Мой" ;
		let b="Зеленый";
		let c="Kрокодил";
		const user55 = {
			name:name55,
			isAdmin,
			isArr,
			[propName]:"jon Dou",
			[(a+ " " + b+ " " + c).toLowerCase()]:"Гена"
		};
		
		console.log(user55);//мой зеленый kрокодил: "Гена"

		пример

		let str1 = 'new string';
		let str2 = str1.slice(0);

		 console.log(str1);//new string
		 console.log(str2);//new string

		 str1='some else'
		 console.log(str1);//some else
		 console.log(str2);//new string

		 пример

		 let user96 = { name: 'Вася'};
         let visitor = { isAdmin: false, visits: true };
         let admin = { isAdmin: true };
         // первое свойство объекта user96 примет в себя
         Object.assign(user96, visitor, admin); //копируем в первый
         console.log(user96);//isAdmin:true name:"Вася" visits:true

        препишем через spred оператор

         let user96 = { name: 'Вася'};
         let visitor = { isAdmin: false, visits: true };
         let admin = { isAdmin: true };
         // первое свойство объекта user96 примет в себя
         // Object.assign(user96, visitor, admin); //копируем в первый
       сonst clone2 = { ...user96, ...visitor, ...admin };
        console.log(clone2) //{ name: 'Вася', isAdmin: true, visits: true }

        тепрь чздстрктрзацию поместим все в  массив

        let user96 = { name: 'Вася'};
         let visitor = { isAdmin: false, visits: true };
         let admin = { isAdmin: true };
         // первое свойство объекта user96 примет в себя
         // Object.assign(user96, visitor, admin); //копируем в первый
       сonst clone2 = { ...user96, ...visitor, ...admin };
        console.log(clone2) //{ name: 'Вася', isAdmin: true, visits: true }
        const { name, visits } = clone2;
// const name = clone2.name;
console.log(name); //Вася
console.log(visits); //true

// пример
let user94 = {
	name:'Петя',
	sayHello:function(){
		console.log('Hello'+' ' + user94.name)
	}
};
user94.sayHello();//Hello Петя

теперь заменим user94 на this
this указывает на объект до точки user94.sayHello(); 


let user94 = {
	name:'Петя',
	sayHello:function(){
		console.log('Hello'+ ' ' + this.name);
		console.log(this);
	}
};
user94.sayHello();//Hello Петя

усложним и допишем функцию
теперь this укажет на глобальный объект,но не на  user94
let user94 = {
	name:'Петя',
	sayHello:function(){
		console.log('Hello'+ ' ' + this.name);
		console.log(this);
	}
	function foo(){
		console.log(this);
	}
	return foo();
};
user94.sayHello();

пример
              
            
!
999px

Console