#trueunderstanding
Explore tagged Tumblr posts
marandsviet · 9 months ago
Text
We often mistake physical proximity for emotional closeness. True intimacy is built on shared experiences, vulnerability, and mutual understanding, regardless of physical distance.
2 notes · View notes
ngocngadotnet · 1 year ago
Text
Check out Vietnamese and Chinese versions: https://ngocnga.net/empathy-first/?utm_source=tumblr&utm_medium=social&utm_campaign=quote 🌿❤️🤗 One who has not experienced hardship cannot offer advice on how to be magnanimous. // Wèicháng jūn kǔ, bù quàn dà dù.
1 note · View note
spiritualsoull1969 · 2 years ago
Text
"Beyond the Sands of Time: Nurturing Genuine Friendships in the Tapestry of Understanding"
Tumblr media
उम्र से
कोई लेना देना नहीं होता
जहां विचार मिलते हैं
वहां सच्ची दोस्ती होती है
याद रखिये समझ...
ज्ञान से ज्यादा गहरी होती है
बहुत से लोग
*आपको जानते हैं परंतु
कुछ ही हैं जो
आपको समझते हैं
Introduction:
The wisdom embedded in "उम्र से कोई लेना देना नहीं होता, जहां विचार मिलते हैं वहां सच्ची दोस्ती होती है, याद रखिये समझ... ज्ञान से ज्यादा गहरी होती है, बहुत से लोग *आपको जानते हैं परंतु कुछ ही हैं जो आपको समझते हैं" invites exploration into the profound nature of true friendships that surpass the boundaries of time and understanding.
Understanding the Essence of True Friendships:
Ageless Bonds: This article delves into the timeless quality of genuine friendships, highlighting how age holds no significance in the formation of deep and meaningful connections. It explores the enduring nature of bonds that withstand the test of time.
Shared Perspectives: Unpacking the significance of shared perspectives, the article discusses how true friendships are forged where thoughts converge. It explores the importance of mutual understanding and the role it plays in fostering lasting bonds.
Depth Beyond Knowledge: The article explores the idea that genuine friendships transcend the realm of mere acquaintance. It delves into the depth of understanding that goes beyond surface-level knowledge, emphasizing the profound connection that arises from truly comprehending one another.
The Dynamics of Understanding:
The Nuances of Comprehension: Delving into the nuances of comprehension, the article discusses how true understanding goes beyond mere recognition. It explores the layers of insight required to truly grasp the intricacies of an individual, fostering a deeper bond.
Genuine Recognition: Recognizing the distinction between knowing and understanding, the article emphasizes the rarity of those who genuinely comprehend an individual. It explores the significance of being seen and understood for authentic connections to flourish.
Wisdom in Understanding: The article explores the wisdom inherent in understanding, surpassing the knowledge of mere facts. It discusses how perceiving the nuances of an individual's thoughts and emotions contributes to the richness of genuine friendships.
Navigating the Shallows of Acquaintance:
Superficial Connections: Addressing the prevalence of superficial connections, the article discusses how many may know of an individual but only a select few truly understand. It explores the pitfalls of surface-level relationships in the digital age.
Quality Over Quantity: Emphasizing the importance of quality over quantity, the article explores the idea that true friendships are not measured by the number of acquaintances but by the depth of understanding shared with a chosen few.
The Loneliness of Shallow Relationships: The article delves into the loneliness that can accompany shallow relationships, contrasting it with the warmth and fulfilment found in connections where understanding runs deep. It explores the emotional toll of lacking true comprehension.
The Timeless Nature of True Friendships:
Evolving Connections: The article explores how genuine friendships evolve with time, adapting to the changing landscapes of life. It discusses the dynamic nature of connections that withstand the challenges posed by the passage of time.
Through Thick and Thin: Delving into the concept of steadfast companionship, the article discusses how true friendships endure both the joys and hardships of life. It explores the comfort derived from knowing that understanding remains constant through thick and thin.
Aging Together, Growing Together: The article explores the beauty of aging together and growing together in true friendships. It discusses how shared experiences and understanding deepen over time, creating a tapestry of memories that fortify the bond.
Cultural and Philosophical Perspectives on Understanding:
Cultural Notions of Friendship: The article examines cultural perspectives on friendship, exploring how different societies value and define the essence of true companionship. It delves into cultural nuances that influence the dynamics of understanding in friendships.
Philosophical Insights on Comprehension: Delving into philosophical traditions, the article explores insights on the nature of comprehension in relationships. It discusses how philosophers across cultures have reflected on the depth of understanding as a cornerstone of genuine connections.
The Role of Empathy in True Friendships:
The Empathetic Thread: Emphasizing the role of empathy, the article discusses how true friendships are woven with the empathetic thread. It explores the ability to step into each other's shoes, fostering a deeper level of understanding and connection.
Empathy as a Bridge: The article delves into empathy as a bridge that spans the gaps in comprehension. It explores how the capacity to empathize strengthens the fabric of friendships, allowing individuals to connect on a soulful level.
Conclusion:
"उम्र से कोई लेना देना नहीं होता, जहां विचार मिलते हैं वहां सच्ची दोस्ती होती है, याद रखिये समझ... ज्ञान से ज्यादा गहरी होती है, बहुत से लोग *आपको जानते हैं परंतु कुछ ही हैं जो आपको समझते हैं" unfolds the intricate tapestry of genuine friendships, transcending time and understanding. This article explores the essence of true connections, delving into the dynamics of comprehension, and celebrating the rare gems who truly understand. By navigating the depths of understanding, individuals can foster enduring friendships that stand resilient against the sands of time.
0 notes
meditateplanet · 2 months ago
Text
Tumblr media
To understand everything, hold on to nothing. 🌀🧘‍♂️✨ #NonAttachment #ZenWisdom #TrueUnderstanding
21 notes · View notes
hausofasseveration · 5 months ago
Text
Beware of Spiritual Egos: The Hidden Dangers
We explore the unsettling rise of spiritual egos and how they can distort true understanding. Discover the harmful effects of superficial changes in mindset and lifestyle, and learn why the consciousness of our circle is crucial to genuine growth. #SpiritualEgo #Mindfulness #PersonalGrowth #TrueUnderstanding #SelfAwareness #ConsciousLiving #SpiritualAwakening #CommunityImpact #HolisticHealth…
0 notes
agnieos · 4 years ago
Video
youtube
Angela Merkel - Navigating a world in crisis | DW Documentary
The golden Lady Guin
0 notes
yesimmortalspiritblog · 5 years ago
Video
Just a tiny bit of wisdom here ~ All illusional worlds are under the shroud of Heaven. There are no dream worlds that are in and beyond Heaven. There is only one true Kingdom and it is everyones choice to enter. I let God lead the way and as long as I 100% listen to His Voice, I triumph in everything I think, say and do. Because with Him I can never fail because He never fails. True knowledge and understanding comes only from the Kingdom of Heaven. It is everyones choice to learn what true wisdom and understanding is. This brings true comfort and freedom. What illusion offers is self-deceptive. To rise beyond it takes willingness and holiness does the rest. . Enjoy this tiny piece of wisdom ~ In worlds of illusion everything repeats itself until time enters the phase of enlightenment. This is where minds begin to open wide to knew ideas. My hope is that the knew ideas are for the betterment of humanities comfort and true freedom. In ideas, it does not matter who thought it first, did it first, said it first or wrote it first. Everything in illusion is a repeat of past, present and future until mind enters divine senses, true reality. And that's just how it is! So let go of selfishness and greed and let comfort and freedom proceed down the path of righteousness where in love, joy and peace, we generously share everything! This is the ultimate Oneness. Author ~ 🕊@godzillionloveandlight . . . #wisdomandunderstanding #truewisdom #trueunderstanding #truecomfort #truefreedom #forthesakeofhumanity #listentoholiness #dreamworlds #illusionalworlds #deceptive #dreamsaredeceptive #dreaming #wealldream https://www.instagram.com/p/CGNMXWul0TR/?igshid=1xhnaum66zxqs
0 notes
theiridescentgoddess · 7 years ago
Photo
Tumblr media
✨💅🏾Pun intended 💅🏾✨ aka the song of your people, “ ...you’re so vain I bet you think song is about you, don’t you?” . : My favorite thing is when folks are surprised when defend yourself against their store brand bullshit and other people who consider themselves (unbeknownst to you) your enemy, competition or prey get triggered... and it wasn’t even about them. But thanks for showing me your hand... your poker face is showing and that happens to be your tell👌🏾#missmewiththebullshit #weaksauce #onone #goddoesntgiveyoupatience #therejoicingdaughter #opportunitytobebetter #goddesshit #theiridescentgoddess #blackbaldwomen #blackgirlmagic #punintended #fuckyourfeelings #thisonesforyou #nodoubtaboutit #bet #theiridescentlifestyle #ego #narcissism #manifesting #empathstrong #egodeath #internalinventory #higherconsciousness #trueunderstanding #selah #ase (at Status ain't about you)
1 note · View note
mylchee · 5 years ago
Photo
Tumblr media
#daily #motivation #openmind #trueunderstanding 💭 Keep An Open Mind For True Understanding 💭 ⚡️ Today’s motivation is about keeping an open mind, without judgement, to truly understand what is in your heart ❤️ with joy and carrying that knowing with you throughout the day to dispel the fear of uncertainty. ⭐️ Tag someone who needs to hear this. 💬 Leave a comment below! 👇 #mylchee #morning #motivation #heart #knowing #dispelfear #dispeluncertainty #aspiration #quote #starttheday #mood #setting #intentions #mornings #inspiration (at Scarborough) https://www.instagram.com/p/CDEQJ6KB0mw/?igshid=1wjtvtnkn7uff
0 notes
carterj3236 · 5 years ago
Photo
Tumblr media
Letting go of what we can not control, taking ownership of what I can. Embracing our true selves (no better time but the present). 🍃🌿🌳 . . . . #youarepowerful #boundaries #partswork #believeinyourself #vulnerabilityisstrength #acceptance #brave #selflove #confidence #empathy #wisewords #connection #gabormate #brenebrown #carljung #innerlight #gratitude #compassion #positivetone #trueunderstanding #mindfulness #youmatter #itstartswithyou #therapy #kwtherapy #waterlooregion #cambridge #kitchener #waterloo #janinefischertherapy https://www.instagram.com/p/B-FL_u9ptaz/?igshid=1j1dr9ugg8sjl
0 notes
nadeensnyders · 7 years ago
Photo
Tumblr media
🌼 a particular attitude towards or way of regarding something; a point of view. • 🌸 true understanding of the relative importance of things; a sense of proportion • 🌺 Perspective is key 🔑 • • • • #Perspective #Know #Vision #PerspectiveIsKey #View #PointOfView #True #Truth #TrueUnderstanding #Key #Importance #Attitude #SenseOfProportion #Good #Definition #Best #Well (at Mondeor Johanesburg) https://www.instagram.com/p/BoKf1ChBOuE/?utm_source=ig_tumblr_share&igshid=1b499vnkjmdko
0 notes
ngocngadotnet · 1 year ago
Text
Tumblr media
Check out Vietnamese and Chinese versions: https://ngocnga.net/empathy-first/?utm_source=tumblr&utm_medium=social&utm_campaign=quote 🌿❤️🤗 One who has not experienced hardship cannot offer advice on how to be magnanimous. // Wèicháng jūn kǔ, bù quàn dà dù.
1 note · View note
freyayuki · 6 years ago
Text
freeCodeCamp Object Oriented Programming Notes Part 2
I’m currently going through the new freeCodeCamp learning curriculum. I just finished the first part, which was the Responsive Web Design Certification course. Part of this course was to make responsive web design projects.
Check out the following articles for the notes I took while going through said course:
Flexbox Notes
CSS Grid Notes
Now that I’m done with the Responsive Web Design Certification course, the next course is the Javascript Algorithms And Data Structures Certification course. Check out this post for a list of all the notes I took while going through the first 5 parts of this course.
The sixth part of the JavaScript course is Basic Algorithm Scripting. Check out the notes I took while going through this course:
Part 1
Part 2
The seventh part of the JavaScript course is Object Oriented Programming. This is part 2 of the notes I took while going through said course. You can check out part 1 here.  
You can find the Object Oriented Programming course here: https://learn.freecodecamp.org/javascript-algorithms-and-data-structures/object-oriented-programming
Remember to Set the Constructor Property when Changing the Prototype
Tumblr media
function Wand(wood, core, owner) {  this.wood = wood;  this.core = core;  this.owner = owner; } Wand.prototype = {  constructor: Wand,  maker: "Ollivander",  info: function() {    console.log(`The owner of this wand is ${this.owner}.`);  },  description: function() {    console.log(`This wand is made of ${this.wood} wood and a ${this.core} core.`);  } }; let harrysWand = new Wand("holly", "phoenix feather", "Harry Potter"); console.log(harrysWand.description()); //returns This wand is made of holly wood and a phoenix feather core.
Define the constructor property on the Dog prototype.
function Dog(name) {  this.name = name; } Dog.prototype = {  constructor: Dog,  numLegs: 2,  eat: function() {    console.log("nom nom nom");  },  describe: function() {    console.log("My name is " + this.name);  } };
Understand Where an Object’s Prototype Comes From
an object inherits its prototype directly from the constructor function that created it. For example, here the Bird constructor creates the duck object:
Tumblr media
function Gryffindor(name) {  this.name = name; } let ron = new Gryffindor("Ron Weasley"); Gryffindor.prototype.isPrototypeOf(ron); console.log(Gryffindor.prototype.isPrototypeOf(ron)); //returns true
Use isPrototypeOf to check the prototype of beagle.
function Dog(name) {  this.name = name; } let beagle = new Dog("Snoopy"); Dog.prototype.isPrototypeOf(beagle); console.log(Dog.prototype.isPrototypeOf(beagle)); //returns true
Understand the Prototype Chain
Tumblr media Tumblr media
Modify the code to show the correct prototype chain.
Your code should show that Object.prototype is the prototype of Dog.prototype
function Dog(name) {  this.name = name; } let beagle = new Dog("Snoopy"); Dog.prototype.isPrototypeOf(beagle);  // => true Object.prototype.isPrototypeOf(Dog.prototype); //returns true
function RavenclawStudent(name) {  this.name = name; } console.log(typeof RavenclawStudent.prototype); //returns object console.log(Object.prototype.isPrototypeOf(RavenclawStudent.prototype)); //returns true console.log(RavenclawStudent.hasOwnProperty("name")); //returns true var luna = new RavenclawStudent("Luna Lovegood"); console.log(luna.hasOwnProperty("name")); //returns true
Use Inheritance So You Don't Repeat Yourself
Tumblr media Tumblr media
The eat method is repeated in both Cat and Bear. Edit the code in the spirit of DRY by moving the eat method to the Animalsupertype.
function Cat(name) {  this.name = name; } Cat.prototype = {  constructor: Cat, }; function Bear(name) {  this.name = name; } Bear.prototype = {  constructor: Bear, }; function Animal() { } Animal.prototype = {  constructor: Animal,  eat: function() {    console.log("nom nom nom");  } };
function HogwartsChampion(name) {  this.name = name; } function DurmstrangChampion(name) {  this.name = name; } HogwartsChampion.prototype = {  constructor: HogwartsChampion }; DurmstrangChampion.prototype = {  constructor: DurmstrangChampion }; function TriwizardTournament() {  prize = "1000 Galleons"; } TriwizardTournament.prototype = {  constructor: TriwizardTournament,  description: () => `Inter-school magical competition` }; var cedric = new HogwartsChampion("Cedric Diggory"); var viktor = new DurmstrangChampion("Viktor Krum");
Inherit Behaviors from a Supertype
create a supertype called Animal that defines behaviors shared by all animals:
Tumblr media
how to reuse Animal's methods inside Bird and Dog without defining them again. It uses a technique called inheritance.
the first step: make an instance of the supertype (or parent).
you can create an instance of Animal using the new operator:
let animal = new Animal();
There are some disadvantages when using this syntax for inheritance. Here's an alternative approach without those disadvantages:
Tumblr media
Use Object.create to make two instances of Animal named duck and beagle.
function Animal() { } Animal.prototype = {  constructor: Animal,  eat: function() {    console.log("nom nom nom");  } }; let duck = Object.create(Animal.prototype); let beagle = Object.create(Animal.prototype); duck.eat(); //prints "nom nom nom" beagle.eat(); //prints "nom nom nom"
function Weasleys(name) {  this.name = name; } Weasleys.prototype = {  constructor: Weasleys,  parents: function() {    console.log(`${this.name} is the son of Arthur and Molly Weasley.`);  },  siblings: function() {    console.log(`${this.name} has 5 brothers and 1 sister.`);  } }; let bill = Object.create(Weasleys.prototype); bill = new Weasleys("Bill Weasley"); bill.parents(); //returns Bill Weasley is the son of Arthur and Molly Weasley. bill.siblings(); //returns Bill Weasley has 5 brothers and 1 sister. let charlie = Object.create(Weasleys.prototype); charlie = new Weasleys("Charlie Weasley"); charlie.parents(); //returns Charlie Weasley is the son of Arthur and Molly Weasley. charlie.siblings(); //returns Charlie Weasley has 5 brothers and 1 sister.
Set the Child's Prototype to an Instance of the Parent
the first step for inheriting behavior from the supertype(or parent) Animal: making a new instance of Animal.
the next step: set the prototype of the subtype(or child)—in this case, Bird—to be an instance of Animal.
Tumblr media
Modify the code so that instances of Dog inherit from Animal.
function Animal() { } Animal.prototype = {  constructor: Animal,  eat: function() {    console.log("nom nom nom");  } }; function Dog() { } Dog.prototype = Object.create(Animal.prototype); //Dog.prototype should be an instance of Animal. let beagle = new Dog(); beagle.eat();  //prints "nom nom nom"
function Pet() {} Pet.prototype = {  constructor: Pet,  info: function() {    console.log("This pet belongs to a Hogwarts student.");  } }; function Owl(name, owner) {  this.name = name;  this.owner = owner; } Owl.prototype = Object.create(Pet.prototype); let hedwig = new Owl("Hedwig", "Harry Potter"); hedwig.info(); //returns This pet belongs to a Hogwarts student. let pigwidgeon = new Owl("Pigwidgeon", "Ron Weasley"); pigwidgeon.info(); //returns This pet belongs to a Hogwarts student.
Reset an Inherited Constructor Property
Tumblr media
Fix the code so duck.constructor and beagle.constructor return their respective constructors.
function Animal() { } function Bird() { } function Dog() { } Bird.prototype = Object.create(Animal.prototype); Dog.prototype = Object.create(Animal.prototype); Bird.prototype.constructor = Bird; //Bird.prototype should be an instance of Animal Dog.prototype.constructor = Dog; //Dog.prototype should be an instance of Animal let duck = new Bird(); //duck.constructor should return Bird let beagle = new Dog(); //beagle.constructor should return Dog
function HogwartsStudent() {} function SlytherinStudent(name) {    this.name = name; } function RavenclawStudent(name) {    this.name = name; } SlytherinStudent.prototype = Object.create(HogwartsStudent.prototype); RavenclawStudent.prototype = Object.create(HogwartsStudent.prototype); var pansy = new SlytherinStudent("Pansy Parkinson"); console.log(pansy.constructor); //returns function HogwartsStudent() {} SlytherinStudent.prototype.constructor = SlytherinStudent; console.log(pansy.constructor); //returns ƒ SlytherinStudent(name) {    this.name = name; }
Add Methods After Inheritance
Tumblr media Tumblr media
Add all necessary code so the Dog object inherits from Animal and the Dog's prototype constructor is set to Dog. Then add a bark()method to the Dog object so that beagle can both eat()and bark(). The bark()method should print "Woof!" to the console.
function Animal() { } Animal.prototype.eat = function() { console.log("nom nom nom"); }; function Dog() { } Dog.prototype = Object.create(Animal.prototype); Dog.prototype.constructor = Dog; //Dog should inherit the eat() method from Animal //Dog should have the bark() method as an own property Dog.prototype.bark = function() {    console.log("Woof!"); }; let beagle = new Dog(); //beagle should be an instanceof Animal //The constructor for beagle should be set to Dog beagle.eat(); //prints "nom nom nom" beagle.bark(); //prints "Woof!"
function DeathEater() {} DeathEater.prototype.deatheater = function() {    console.log("This character is a Death Eater."); }; function Pureblood() {} Pureblood.prototype = Object.create(DeathEater.prototype); Pureblood.prototype.constructor = Pureblood; Pureblood.prototype.pureblood = function() {    console.log("This character is a pureblood."); }; let lucius = new Pureblood(); lucius.deatheater(); //returns This character is a Death Eater. lucius.pureblood(); //returns This character is a pureblood. let bellatrix = new Pureblood(); bellatrix.deatheater(); //returns This character is a Death Eater. bellatrix.pureblood(); //returns This character is a pureblood.
function Student() {} Student.prototype.info = () => `Young witch or wizard learning magic in school.`; function HogwartsStudent(name) {    this.name = name; } HogwartsStudent.prototype = Object.create(Student.prototype); HogwartsStudent.prototype.constructor = HogwartsStudent; HogwartsStudent.prototype.school = () => `Witch or wizard studying in Hogwarts School of Witchcraft and Wizardry.`; var dean = new HogwartsStudent("Dean Thomas"); console.log(dean.info()); //returns Young witch or wizard learning magic in school. console.log(dean.school()); //returns Witch or wizard studying in Hogwarts School of Witchcraft and Wizardry. console.log(dean instanceof HogwartsStudent); //returns true
Override Inherited Methods
an object can inherit its behavior (methods) from another object by cloning its prototype object:
Tumblr media
Here's an example of Bird overriding the eat()method inherited from Animal:
Tumblr media
Override the fly()method for Penguin so that it returns "Alas, this is a flightless bird."
function Bird() { } Bird.prototype.fly = function() { return "I am flying!"; }; function Penguin() { } Penguin.prototype = Object.create(Bird.prototype); Penguin.prototype.constructor = Penguin; Penguin.prototype.fly = function() {    return "Alas, this is a flightless bird." } let penguin = new Penguin(); console.log(penguin.fly()); //returns Alas, this is a flightless bird.
function FoundersItems() {} FoundersItems.prototype.item = function() {    return "This item belongs to one of the Hogwarts Founders."; }; function VoldemortsItems() {} VoldemortsItems.prototype = Object.create(FoundersItems.prototype); VoldemortsItems.prototype.constructor = VoldemortsItems; VoldemortsItems.prototype.item = function() {    return "This item is one of Voldemort's horcruxes."; }; let ravenclawsDiadem = new VoldemortsItems(); console.log(ravenclawsDiadem.item()); //returns This item is one of Voldemort's horcruxes. let slytherinsLocket = new VoldemortsItems(); console.log(slytherinsLocket.item()); //returns This item is one of Voldemort's horcruxes.
function Headmaster() {} Headmaster.prototype.info = () => `Headmaster of a magical school for witches and wizards.`; function HogwartsHeadmaster() {} HogwartsHeadmaster.prototype = Object.create(Headmaster.prototype); HogwartsHeadmaster.prototype.constructor = HogwartsHeadmaster; HogwartsHeadmaster.prototype.info = () => `Albus Dumbledore is the Headmaster of Hogwarts School of Witchcraft and Wizardry.`; var albus = new HogwartsHeadmaster(); console.log(albus.info()); //returns Albus Dumbledore is the Headmaster of Hogwarts School of Witchcraft and Wizardry. function DurmstrangHeadmaster(name) {    this.name = name; } DurmstrangHeadmaster.prototype = Object.create(Headmaster.prototype); DurmstrangHeadmaster.prototype.constructor = DurmstrangHeadmaster; DurmstrangHeadmaster.prototype.info = () => `This is the Headmaster of Durmstrang Institute.`; var igor = new DurmstrangHeadmaster("Igor Karkaroff"); console.log(igor.info()); //returns This is the Headmaster of Durmstrang Institute.
Use a Mixin to Add Common Behavior Between Unrelated Objects
behavior is shared through inheritance. However, there are cases when inheritance is not the best solution. Inheritance does not work well for unrelated objects like Bird and Airplane. They can both fly, but a Bird is not a type of Airplane and vice versa.
Tumblr media Tumblr media
Create a mixin named glideMixin that defines a method named glide. Then use the glideMixin to give both bird and boat the ability to glide.
let bird = {  name: "Donald",  numLegs: 2 }; let boat = {  name: "Warrior",  type: "race-boat" }; let glideMixin = function(obj) {    obj.glide = function() {        console.log("This object can glide.");    } }; glideMixin(bird); glideMixin(boat); bird.glide(); //returns This object can glide. boat.glide(); //returns This object can glide.
let pansy = {    name: "Pansy Parkinson",    student: true }; let draco = {    name: "Draco Malfoy",    student: true,    mother: "Narcissa",    father: "Lucius" }; let slytherinMixin = function(obj) {    obj.slytherin = function() {        console.log("This student is a Slytherin.");    } }; slytherinMixin(pansy); slytherinMixin(draco); pansy.slytherin(); draco.slytherin(); //both return This student is a Slytherin. let purebloodMixin = function(obj) {    obj.pureblood = function() {        console.log("This witch or wizard is a pureblood.");    } }; purebloodMixin(pansy); purebloodMixin(draco); pansy.pureblood(); draco.pureblood(); //both return This witch or wizard is a pureblood.
var cho = {  name: "Cho Chang",  house: "Ravenclaw" }; var ginny = {  name: "Ginny Weasley",  house: "Gryffindor" }; var daMixin = (obj) => {  obj.da = () => `This witch or wizard is a member of the DA or Dumbledore's Army.`; }; daMixin(cho); daMixin(ginny); console.log(cho.da()); //returns This witch or wizard is a member of the DA or Dumbledore's Army. console.log(ginny.da()); //returns This witch or wizard is a member of the DA or Dumbledore's Army.
Use Closure to Protect Properties Within an Object from Being Modified Externally
Tumblr media
Here getHachedEggCount is a privileged method, because it has access to the private variable hatchedEgg. This is possible because hatchedEgg is declared in the same context as getHachedEggCount. In JavaScript, a function always has access to the context in which it was created. This is called closure.
Change how weight is declared in the Bird function so it is a private variable. Then, create a method getWeight that returns the value of weight.
function Bird() {  let weight = 15;  this.getWeight = function() {    return weight;  }     }
function HogwartsFounders() {  var founders = "The 4 Hogwarts Founders are: Slytherin, Hufflepuff, Ravenclaw, and Gryffindor.";  this.getFounders = () => founders; } var rowena = new HogwartsFounders(); console.log(rowena.getFounders()); //returns The 4 Hogwarts Founders are: Slytherin, Hufflepuff, Ravenclaw, and Gryffindor. var helga = new HogwartsFounders(); console.log(helga.getFounders()); //returns The 4 Hogwarts Founders are: Slytherin, Hufflepuff, Ravenclaw, and Gryffindor.
Understand the Immediately Invoked Function Expression (IIFE)
Tumblr media
Rewrite the function makeNest and remove its call so instead it's an anonymous immediately invoked function expression (IIFE).
function makeNest() {  console.log("A cozy nest is ready"); } makeNest();
Answer:
(function () {  console.log("A cozy nest is ready"); })(); //this function immediately outputs or returns A cozy nest is ready
More examples:
(function() {  console.log("The Chamber of Secrets has been opened. Enemies of the heir beware."); }) (); //this function is anonymous //this function is immediately called or executed //returns "The Chamber of Secrets has been opened. Enemies of the heir beware." right away
(() => `I solemnly swear that I am up to no good!`)(); //this function immediately returns "I solemnly swear that I am up to no good!"
(() => { var x = 20; var y = 20; var answer = x + y; console.log(answer); })(); //immediately returns 40
Use an IIFE to Create a Module
Tumblr media Tumblr media
Create a module named funModule to wrap the two mixinsisCuteMixin and singMixin. funModule should return an object.
funModule.isCuteMixin should access a function.
funModule.singMixin should access a function.
let isCuteMixin = function(obj) {  obj.isCute = function() {    return true;  }; }; let singMixin = function(obj) {  obj.sing = function() {    console.log("Singing to an awesome tune");  }; };
Answer:
let funModule = (function () {  return {    isCuteMixin: function(obj) {      obj.isCute = function() {        return true;      };    },    singMixin: function(obj) {      obj.sing = function() {        console.log("Singing to an awesome tune");      };    }  } }) ()
//or, using arrow functions let funModule = (() => {  return {    isCuteMixin: (obj) => {      obj.isCute = () => true;    },    singMixin: (obj) => {      obj.sing = () => `Singing to an awesome tune`;    }  } }) ();
More examples:
var hogwartsModule = (() => {  return {    ravenclawMixin: (obj) => {      obj.ravenclaw = () => `This witch or wizard is a Ravenclaw student.`;    },    hufflepuffMixin: (obj) => {      obj.hufflepuff = () => `This witch or wizard is a Hufflepuff student.`;    },    gryffindorMixin: (obj) => {      obj.gryffindor = () => `This witch or wizard is a Gryffindor student.`;    },    slytherinMixin: (obj) => {      obj.slytherin = () => `This witch or wizard is a Slytherin student.`;    }  } }) (); function RavenclawStudent() {} function HufflepuffStudent() {} function GryffindorStudent() {} function SlytherinStudent() {} var astoria = new SlytherinStudent(); hogwartsModule.slytherinMixin(astoria); console.log(astoria.slytherin()); //returns This witch or wizard is a Slytherin student. var marietta = new RavenclawStudent(); hogwartsModule.ravenclawMixin(marietta); console.log(marietta.ravenclaw()); //returns This witch or wizard is a Ravenclaw student. var oliver = new GryffindorStudent(); hogwartsModule.gryffindorMixin(oliver); console.log(oliver.gryffindor()); //returns This witch or wizard is a Gryffindor student. var cedric = new HufflepuffStudent(); hogwartsModule.hufflepuffMixin(cedric); console.log(cedric.hufflepuff()); //returns This witch or wizard is a Hufflepuff student.
var bloodStatus = (() => {  return {    purebloodMixin: (obj) => {      obj.pureblood = () => `This witch or wizard is a pureblood.`;    },    mugglebornMixin: (obj) => {      obj.muggleborn = () => `This witch or wizard is a muggleborn.`;    },    halfbloodMixin: (obj) => {      obj.halfblood = () => `This witch or wizard is a half-blood.`;    }  } }) (); function Pureblood() {}; function Muggleborn() {}; function HalfBlood() {}; var bellatrix = new Pureblood(); bloodStatus.purebloodMixin(bellatrix); console.log(bellatrix.pureblood()); //returns This witch or wizard is a pureblood. var hermione = new Muggleborn(); bloodStatus.mugglebornMixin(hermione); console.log(hermione.muggleborn()); //returns This witch or wizard is a muggleborn. var snape = new HalfBlood(); bloodStatus.halfbloodMixin(snape); console.log(snape.halfblood()); //returns This witch or wizard is a half-blood.
0 notes
meditateplanet · 4 months ago
Text
Tumblr media
In the absence of judgment, true understanding blossoms. 🌸🧠🌿 #NonJudgment #Mindfulness #TrueUnderstanding
3 notes · View notes
pretidev · 7 years ago
Video
instagram
“Talk is easy; action is difficult. Action is easy; true understanding is even more difficult.” “Practice with a meaning” - Pretidev. @karate @karatephilosophy @philosophy @kenpokarate @kempo @kenpo shorinjikempo @shorinryu @shorinkan @shotokan @shitoryu @shorinji @action @trueunderstanding @practice @practicewithameaning @okinawa @okinawankarate (at Flic En Flac, Black River, Mauritius) https://www.instagram.com/p/BphsziGFsU-HT2d8-0tRiaoF2Oqo-KQMRu7wiY0/?utm_source=ig_tumblr_share&igshid=12xggbubin4t
0 notes
meditateplanet · 4 months ago
Text
Tumblr media
To understand the universe, study a grain of sand. 🪨🔍✨ #ZenWisdom #Mindfulness #TrueUnderstanding
1 note · View note